package genetic.q3;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.Stack;

import genetic.Function;
import genetic.Genotype;
import genetic.Terminal;
import genetic.TreeNode;
import genetic.q3.functions.Computable;
import genetic.q3.functions.DoubleConstant;

public class SymbolicRegressionGenotype extends Genotype {

	double fitness;

	public SymbolicRegressionGenotype(TreeNode tree) {
		super(tree);
	}

	@Override
	public Genotype clone() {
		return new SymbolicRegressionGenotype(tree.clone());
	}

	public double getFitness() {
		return fitness;
	}

	public void computeFitness(double[][] points) {
		//instead of computing  the absolute error, we compute the relative error
		fitness = 0;
		for (int i=0; i<points.length; i++){
			double res = Math.abs(points[i][1] - ((Computable)tree).compute(points[i][0]));
			if (points[i][1] == 0){
				if (res!=0){
					fitness = fitness + res/0.0001;
				}
			} else {
				fitness = fitness + res/Math.abs(points[i][1]);	
			}
		}
		//now the fitness is the average relative error
		fitness = fitness/points.length;

		if (fitness == 0){ fitness = Double.MAX_VALUE; System.out.println("Found 0 error!!!");}

		else fitness = 1/fitness;

		if ((fitness+"").equals("NaN")){
			fitness = 0;
		}

		//Punishment for being oversize
		if (tree.getDepth() > 20){
			fitness = fitness / (tree.getDepth()/20);
		}
	}

	@Override
	public String toString() {
		double tmp = fitness;
		if (tree.getDepth() > 20){
			tmp = tmp / (tree.getDepth()/20);
		}

		if (tmp == 0){
			return "Infinity" + " - " + tree.toString();	
		} else {
			return (1/tmp) + " - " + tree.toString();
		}
	}

	public TreeNode getMinimzedFunction(TreeNode tree){
		if (!tree.isFunction()){
			return tree.clone();
		} else {
			boolean flag = true;
			TreeNode[] kids = ((Function)tree).getKids();
			TreeNode[] newkids = new TreeNode[kids.length];
			for (int i=0 ; i<kids.length; i++){
				newkids[i] = getMinimzedFunction(kids[i]);
				if (newkids[i].isFunction() || newkids[i].getName().equals("X")){
					flag = false;
				}
			}
			if (flag){
				return new DoubleConstant(((Computable)tree).compute(0));
			} else {
				return ((Function)tree).createInstance(newkids);
			}
		}
	}

	public static TreeNode parse(Collection<Terminal> terminals, Collection<Function> functions, String str){
		Stack<TreeNode> s = new Stack<TreeNode>();
		Stack<String> f = new Stack<String>();
		while(str.length()>0){
			//			System.out.println(str);
			if (str.charAt(0)=='('){
				str = str.substring(1);
				String tmp = str.substring(0, str.indexOf(' '));
				f.push(tmp);
				str = str.substring(Math.min(str.length(), str.indexOf(' ')+1));
			} else if (str.charAt(0)==')'){
				String tmp = f.pop();
				str = str.substring(1);
				s.push(getTreeNode(terminals, functions, tmp, s));
				str = str.trim();
			} else {
				int selectedIndex = 0;
				int spaceIndex = str.indexOf(' ');
				int closeIndex = str.indexOf(')');
				if (spaceIndex==-1) selectedIndex = closeIndex;
				else if (closeIndex==-1) selectedIndex = spaceIndex;
				else selectedIndex = Math.min(spaceIndex, closeIndex);
				String tmp = str.substring(0, selectedIndex);
				s.push(getTreeNode(terminals, functions, tmp, null));
				if (selectedIndex==closeIndex){
					str = str.substring(Math.min(str.length(), selectedIndex));
				} else {
					str = str.substring(Math.min(str.length(), selectedIndex+1));
				}
				str = str.trim();
			}
		}
		return s.pop();
	}

	public static TreeNode getTreeNode(Collection<Terminal> terminals, Collection<Function> functions, String f, Stack<TreeNode> args){
		for (Terminal t: terminals){
			if (f.equals(t.getName())){
				return t.clone();
			}
		}
		for (Function func: functions){
			if (f.equals(func.getName())){
				TreeNode[] kids = new TreeNode[func.getNumKids()];
				for (int i=kids.length-1; i>=0; i--){
					kids[i] = args.pop();
				}
				return func.createInstance(kids);
			}
		}
		return null;
	}

	public void printPoints(double[][] points, PrintWriter out) {
		fitness = 0;
		for (int i=0; i<points.length; i++){
			double res =  ((Computable)tree).compute(points[i][0]);
			out.println(points[i][0]+"\t"+res);
		}
	}

	public static void main(String[] args) {
		SRFileReader sfr = new SRFileReader();
		String[] strs = new String[]{
				//no hints functions
				"(max (tan (max (tan (min X (/ (sin 1) (/ (rint X) (hypot 3 2))))) (* 2 (max (pow (sin (pow X (sin 1))) (pow X (pow X (floor (tan (sin (tan (sin (sin (ceil (acos (pow (pow (sin 1) (cosh 3)) (sin 1))))))))))))) (ceil (asin (ceil (/ (max (cbrt (toRadians (ceil (toDegrees 1)))) (max (asin (max (sin 1) (asin (ceil (sin (ceil (max (sin 1) (ceil (ceil (ceil (sin (pow (max (sin (/ (rint 2) (hypot 1 5))) (acos (max (floor X) (floor 5)))) (pow (acos (pow (sin (pow X (sin 1))) (acos (ceil (acos (pow (sin (pow (abs (pow X (sin 1))) (sin 1))) (sin 1))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3))))))))))))))))))))) (max (* (max (sin 1) (max (max (sin 1) (acos (max (tan (min X (tan (min X X)))) (max (pow (tan (tan (tan (sin (ceil (sin (ceil (acos (pow X (/ (pow (atan2 (pow 1 2) (expm1 3)) (sin 1)) (expm1 (max (expm1 (pow X (sin (pow (sin 1) (floor (* 4 1)))))) (floor 5))))))))))))) (sin 1)) (atan2 (acos (max (floor (log1p 5)) (floor 5))) (acos (pow (sin (pow X (sin 1))) (max (sin (max 3 (asin (abs (pow X (abs (max (cbrt (tan 4)) (signum (exp X))))))))) (asin (abs (pow X (abs (max (hypot 3 (max (cbrt (tan 4)) (signum (exp X)))) (signum (exp X))))))))))))))) (floor 5))) 5) (floor 5)))) (ceil (asin (+ (pow (acos (ceil (max (ceil (acos (pow (sin (/ (max (sin (sin 1)) (max (max (acos (ceil (floor X))) (/ (max (acos (ceil (floor X))) (ceil 1)) (/ (toRadians (- 1 5)) (expm1 4)))) (floor 5))) (sin (pow X (sin 1))))) (sin 1)))) (atan2 (pow (max (max (max (pow X (abs (max (cbrt (abs (* 1 3))) (signum (exp X))))) (asin (min (pow (/ (pow (max (sqrt (- 3 3)) (asin (/ (tan (min X (tan (min X (/ (sin 1) (/ (rint X) (hypot 3 2))))))) (/ (rint X) (hypot 3 2))))) (sin 1)) (expm1 (max (expm1 (pow X (sin (/ (sin (pow (sin 1) (* 2 1))) (expm1 (pow X (abs (max (cbrt (tan 4)) (signum (exp X)))))))))) (floor 5)))) (sin 1)) X))) (sin (* 1 5))) (asin (min (pow (max (sqrt (- 3 3)) (asin (/ (tan (min X (tan (min X (/ (sin 1) (/ (rint X) (hypot 3 2))))))) (/ (rint X) (hypot 3 2))))) (sin 1)) X))) (pow X (ceil (acos (pow X (abs (acos (pow X (sin 1))))))))) (max (+ (acos (pow (max (sin (/ (rint 2) (hypot 1 5))) (acos (max (floor X) (floor 3)))) (pow (acos (pow (acos (pow (sin (pow X (sin 1))) (acos (ceil (acos (sqrt (sin 4))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3)))))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3))))))))))) (* 1 (+ (acos (pow (max (sin (/ (rint 2) (hypot 1 5))) (acos (max (floor X) (floor 3)))) (pow (acos (pow (acos (pow (sin (pow X (sin 1))) (acos (ceil (acos (sqrt (sin 4))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3)))))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3))))))))))) (max (+ (acos (pow (max (sin (/ (rint 2) (hypot 1 5))) (acos (max (floor X) (floor 3)))) (pow (acos (pow (acos (pow (sin (pow X (sin 1))) (acos (max (tan (min X (tan (min X X)))) (acos (ceil (acos (sqrt (sin (expm1 (asin 2))))))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3)))))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3))))))))))) (floor (+ (pow (acos (pow (acos (sin (acos (ceil (acos (pow X (sin 1))))))) (sin (floor (sin (pow (sin (sin (sin (floor X)))) (sin 1))))))) (sin 1)) 5))) (floor 5))))) (sin (max (pow X (pow X (floor (tan (sin 5))))) (asin (abs (max (abs (sin (tan (rint (* X 5))))) (* (sin (pow 1 2)) 5))))))))))) (sin (max (sin 1) (acos (atan2 (acos (max (floor (log1p 5)) (floor 5))) (tan (tan (tan (rint (* X 5)))))))))) (asin (/ (max (+ (pow (acos (ceil (acos (pow X (sin 1))))) (sin 1)) (floor (+ (pow (acos (ceil (acos (pow X (sin 1))))) (sin 1)) (pow X (sin (pow X (sin 1))))))) (sin (max 3 (asin (abs (max (abs (sin (tan (rint (* X 5))))) (floor X))))))) (expm1 (abs (expm1 (acos (pow (max (tan X) (pow (max (tan X) (asin (min (sin (min (cbrt (abs (* 1 3))) (log1p 5))) X))) (sin 1))) (max (cbrt (tan 4)) (pow (sin (pow (atan2 (pow (pow (max (tan X) (asin (floor (/ 5 5)))) (pow (sin (asin (cos 2))) (sin 1))) (sin 1)) 1) (sin 1))) (* X 5))))))))))))))))))))) (* (pow (acos (ceil (acos (pow (max (sin (/ (rint 2) (hypot 1 5))) (acos (max (floor X) (floor 5)))) (pow (acos (pow (sin (pow X (sin 1))) (acos (ceil (acos (pow (sin (pow (abs (pow X (sin 1))) (sin 1))) (sin 1))))))) (pow X (abs (acos (/ (tan (ceil (tan (min X X)))) (expm1 (pow (expm1 4) (floor (ceil 3))))))))))))) (ceil (pow (acos (ceil (acos (pow X (pow (acos (ceil (acos (pow (sin (pow X (sin 1))) (sin 1))))) (pow X (ceil (pow (ceil (acos (pow X (abs (acos (pow X (sin 1))))))) (max (pow (tan (tan (tan (sin (ceil (sin (ceil (acos (pow X (/ (pow (atan2 (pow 1 2) (expm1 3)) (sin (floor 5))) (expm1 (max (expm1 (pow X (sin (/ (sin (pow (sin 1) (* 2 1))) (expm1 (pow X (abs (max (cbrt (tan 4)) (signum (exp X)))))))))) (floor 5))))))))))))) (sin 1)) (floor (ceil (floor 4)))))))))))) (pow (acos (ceil (acos (pow (acos (ceil (acos (pow X (sin 1))))) (sin 1))))) (sin (sin (sin 1))))))) (max (max (floor (max (max (pow X (+ (max 3 (asin (abs (tan (abs (/ (sin 1) (/ (rint X) (hypot 3 2)))))))) (sin (log1p 5)))) (ceil (asin (ceil (/ (tanh (ceil (log10 (min (ceil (pow (tan (ceil (max (ceil (* 2 (ceil (pow X (sin 1))))) (floor 5)))) (max (pow (pow (pow (tan (tan (tan (min (tan (max (sin 1) (acos (max (* 2 5) (sin (* 1 5)))))) (/ (tan (min X (tan (min X X)))) (/ (rint X) (hypot 3 2))))))) (max (sin 1) (acos (max (* 2 5) (sin (* 1 5)))))) (sin 1)) (max (sin 1) (acos (max (* (max (tan X) (tan (max (tan X) (max (max (tan X) (asin (min (sin (min (sin (ceil (sin 1))) (log1p 5))) X))) (floor X))))) 5) (sin (* 1 5)))))) (floor (max (asin (ceil (acos (ceil (acos (atan2 (acos (* (pow (* 2 1) (pow X (sin (pow (sin 1) (sin 1))))) (ceil (pow X (sin 1))))) (acos (pow (sin (pow X (sin 1))) (max 3 (asin (abs (pow X (abs (max (cbrt (abs (* 1 3))) (signum (exp X)))))))))))))))) (max (acos (max (* (max (sin 1) (max (max (sin 1) (acos (max (* 2 5) (sin (* 1 5))))) (floor 5))) 5) (floor 5))) (floor 5))))))) (abs (acos (/ (max (sin (sin 1)) (max (max (acos (ceil (floor X))) (/ (max (acos (ceil (floor X))) (ceil 1)) (/ (toRadians (- 1 5)) (expm1 4)))) (floor 5))) (pow (sin (pow (abs (acos (max (floor (log1p 5)) (floor 5)))) (sin 1))) (sin (abs (acos (acos (max (* 2 5) (sin (* 1 5))))))))))))))) (ceil (asin (+ (ceil (floor (rint X))) (asin (/ (max (+ (pow (acos (ceil (pow (* 2 1) (sin (* (sin 1) 5))))) (sin 1)) (pow (pow (* 2 1) (pow X (sin (pow X (sin 1))))) (sin (pow X (sin 1))))) (cos (signum X))) (expm1 (acos (pow (max (tan X) (ceil (floor X))) (sin 3)))))))))))))) (min X X))) (min X X)) (ceil (ceil (max (ceil (+ (ceil (floor (rint (/ (rint X) (expm1 (sin (pow (sin 1) (floor (ceil 3))))))))) (ceil (* (pow (* 2 1) (pow X (sin (pow (sin 1) (sin 1))))) (ceil (pow X (sin 1))))))) (acos (max (* (pow X (abs (acos (tan (min X X))))) 5) (expm1 3)))))))))",
				"(+ (IEEEremainder X (+ (IEEEremainder X (+ (floor (expm1 (floor (expm1 (sqrt (IEEEremainder (floor (expm1 (sqrt (IEEEremainder (+ (IEEEremainder X (* (acos (log1p X)) (+ X (+ (+ X 2) (cos (+ (* (+ X (sqrt (expm1 (sqrt (+ (acos (pow 5 (floor 5))) 2))))) (+ X (IEEEremainder X (acos (log1p X))))) (* (signum X) (IEEEremainder (+ (+ X 2) 2) (* (acos (log1p X)) (+ (acos (log1p (+ X 2))) 2)))))))))) (+ (* (acos (sqrt (acos (max 5 X)))) (+ (cos (log1p (cosh (rint 2)))) (* (+ (* (+ (sqrt (IEEEremainder X (* (acos (log1p X)) (* (acos (log1p X)) (+ X (sqrt (+ X 2))))))) (* (+ (sqrt (IEEEremainder X (+ X 2))) 2) (+ X (floor (+ X 2))))) (+ (acos (pow 5 (floor 5))) 2)) (* (+ (sqrt (IEEEremainder X (+ X 2))) 2) (+ X (floor (+ (+ X (acos (+ X 2))) 2))))) (asin (+ (asin (acos 1)) 2))))) 2)) (* (acos (log1p X)) (+ X (floor (+ X 2)))))))) (expm1 (IEEEremainder (floor (expm1 (acos (+ X (acos (+ X 2)))))) (* (acos (log1p (acos (+ (acos (+ (sqrt (IEEEremainder X (* (acos (log1p X)) (+ X 2)))) 2)) (+ X 2))))) (+ (IEEEremainder X (IEEEremainder (+ (IEEEremainder (IEEEremainder (floor (expm1 (sqrt (IEEEremainder (+ (+ X 2) 2) (* (acos (log1p X)) (+ (+ X (cos (+ (+ (+ X (* (acos (log1p (acos 2))) (IEEEremainder (* (acos (log1p (round (log1p (acos 2))))) (asin (acos (log1p X)))) (* (acos (log1p X)) (+ (sqrt (+ 5 1)) (acos (log1p X))))))) 2) (* (acos (log1p (+ (sqrt (+ 5 1)) (acos (log1p X))))) (IEEEremainder (* (acos (log1p (acos 2))) (asin (log1p (asin (acos (acos (acos (log1p X)))))))) (* (acos (log1p X)) (+ (sqrt (+ 5 1)) (+ X 2)))))))) (cos (+ (* (+ X (sqrt (expm1 (sqrt (+ (acos (pow 5 (floor 5))) 2))))) (+ X 2)) (* (acos (log1p (acos 2))) (sqrt (+ (acos (pow 5 (floor 5))) 2))))))))))) (expm1 (IEEEremainder (floor (expm1 (+ X 2))) (IEEEremainder X (IEEEremainder (floor (expm1 (+ X 2))) (* (* (acos (log1p X)) (* (+ (* (log1p (acos 2)) (asin (+ (sqrt (IEEEremainder X (* (acos (log1p X)) (+ (+ X 2) 2)))) (asin (ceil (min 3 X)))))) (IEEEremainder (floor (expm1 (sqrt (max 5 X)))) (* (acos (log1p (acos 2))) (asin (acos 1))))) (asin (sqrt (log1p (cosh (sinh 2))))))) (asin (sqrt (log1p X))))))))) (* (acos (log1p X)) (+ (* (acos (log1p (rint (ulp 3)))) (+ (cos (log1p (sqrt (log1p (* (acos (log1p (acos 2))) (+ (acos (pow 5 (floor 5))) 2)))))) 2)) 2))) 2) (* (sqrt (log1p X)) (+ X (log1p (+ X 2)))))) (+ (+ (IEEEremainder (* (acos (log1p X)) (+ (* (acos (log1p X)) (+ (cos (log1p (IEEEremainder (floor (expm1 2)) (* (acos (log1p (acos 2))) (* (acos (acos (log1p X))) (asin (acos 1))))))) 2)) (sqrt (expm1 (sqrt (+ (IEEEremainder (+ X (sqrt (+ (acos (pow 5 (floor 5))) 2))) (+ X 2)) (sqrt (+ (acos (pow 5 (floor 5))) 2)))))))) (IEEEremainder (+ (IEEEremainder (+ (IEEEremainder (IEEEremainder (+ (* (acos (log1p (acos (ceil (signum X))))) (asin (+ (sqrt (IEEEremainder X (* (acos (log1p X)) (+ X 2)))) (asin (ceil (signum X)))))) (IEEEremainder (floor (expm1 (acos (log1p X)))) (* (acos (log1p (+ (+ X 2) 2))) (asin (acos 1))))) (expm1 (IEEEremainder (floor (* (* (acos (log1p (+ (log1p (+ X 2)) 2))) (* (acos (log1p X)) (acos (log1p (acos 1))))) (acos (log1p (acos 1))))) (expm1 (+ (IEEEremainder (+ (acos (pow 5 (floor 5))) (IEEEremainder X (+ X 2))) (+ X 2)) 2))))) (* (acos (toDegrees (expm1 2))) (+ X (sqrt (acos (log1p (+ X 2))))))) 2) (* (acos (IEEEremainder (acos (log1p X)) (* (+ X (sqrt (expm1 (sqrt (+ (acos (pow 5 (floor 5))) 2))))) (+ X 2)))) (+ (* (acos (IEEEremainder (acos (log1p X)) (* (+ X (sqrt (expm1 (sqrt (+ (acos (pow 5 (floor 5))) 2))))) (+ X (asin (acos 1)))))) (floor (acos (log1p (acos 2))))) 2))) 2) (* (acos (IEEEremainder (acos (+ (acos (log1p X)) (sqrt (+ X 2)))) (* (+ X (* (acos (log1p X)) (+ (acos (log1p (+ X 2))) 2))) (+ X 2)))) (+ (* (acos (IEEEremainder (acos (log1p X)) (* (+ X (sqrt (expm1 (sqrt (+ (acos (pow 5 (floor 5))) 2))))) (+ X (asin (acos 1)))))) (floor (round 3))) 2)))) 2) 2))))))))))) (+ (floor (expm1 (sqrt (IEEEremainder (floor (sqrt (IEEEremainder (floor (expm1 (sqrt (IEEEremainder (+ (IEEEremainder X (* (acos (log1p (acos (log1p X)))) (IEEEremainder (floor (expm1 (* (acos (log1p X)) (+ (acos (log1p (+ X 2))) 2)))) (* (acos (acos (acos (log1p X)))) (* (acos (acos (log1p X))) (asin (acos 1))))))) 2) (* (acos (acos (acos (log1p X)))) (+ X (sin (expm1 3)))))))) (expm1 (IEEEremainder (floor (expm1 (acos (+ X 2)))) (* (acos (* (acos (log1p X)) (ulp (log10 2)))) (+ (IEEEremainder X (IEEEremainder (+ (sqrt (+ (IEEEremainder (IEEEremainder (round (cbrt 2)) (expm1 (IEEEremainder (floor (expm1 (acos (log1p X)))) (* (acos (acos (acos (log1p (acos 2))))) (hypot (sqrt 3) (/ 5 3)))))) (* (acos (log1p X)) (+ (* (acos (sqrt (acos (log1p (+ X 2))))) (+ (cos (log1p (cosh (rint 2)))) (* (+ (* (+ (sqrt (IEEEremainder X (* (acos (log1p X)) (+ X (sqrt (+ X 2)))))) (* (+ (sqrt (IEEEremainder X (+ (ulp (floor 4)) (IEEEremainder X (+ X 2))))) 2) (+ X (floor (+ X 2))))) (+ (acos (pow 5 (floor 5))) 2)) (* (+ (sqrt (IEEEremainder X (+ X 2))) 2) (+ X (floor (+ X 2))))) (asin (acos 1))))) 2))) 2)) 2) (* (sqrt (log1p (IEEEremainder (log1p (floor (expm1 (sqrt (* (sqrt (log1p (abs 2))) (+ X 2)))))) (+ (IEEEremainder (log1p (floor (+ (cos (log1p (sqrt (log1p (* (+ (sqrt (IEEEremainder X (* (acos (log1p X)) (+ X 2)))) 2) (asin (acos (* (acos (log1p X)) (+ X 2))))))))) (tan (abs 2))))) (acos (log1p (+ X (log1p (+ X 2)))))) 2)))) (+ X (IEEEremainder (+ X 2) (* (acos (+ (+ (IEEEremainder (* (acos (log1p X)) (+ X (IEEEremainder (+ X 2) (* (acos (log1p (acos 2))) (hypot (sqrt 3) (/ 5 3)))))) (+ X (IEEEremainder (* (acos (log1p X)) (+ X (acos (+ X (IEEEremainder (+ X 2) 3))))) (* (acos (log1p X)) (+ (cos (log1p (sqrt (log1p X)))) 2))))) 2) 2)) (+ X (+ (+ (acos 2) (+ (+ X 2) 2)) (log1p (+ X 2)))))))))) (+ (+ (IEEEremainder (acos (acos (pow 5 1))) (+ (sqrt (IEEEremainder X (* (acos (log1p X)) (+ X 2)))) 2)) (abs (sqrt 3))) (* (acos (log1p X)) (+ X (floor (+ X 2)))))))))))) (expm1 (IEEEremainder (floor (expm1 (sqrt (IEEEremainder X (* (+ (* (acos (+ X 2)) (+ X 2)) 2) (+ X 2)))))) (* (pow X (cbrt 4)) (+ (IEEEremainder (acos (log1p (acos 2))) (+ X (IEEEremainder (+ (+ (+ X (acos (+ X (acos (sqrt (acos (log1p (acos 2)))))))) 2) (acos (log1p (acos 2)))) (log1p (log1p X))))) 2)))))))) X))) X)) X)",
				"(floor (round (max (- (max (- (round (- (max (floor (max (max (- (floor (- (floor (- (floor (exp (cbrt X))) (floor (- (floor (- (asin (- (asin (asin (- (asin (floor 1)) (- (* (- (asin (floor (asin 5))) X) (floor (floor (sin (asin (sin (floor 5))))))) X)))) (asin (floor (max (round (asin (floor (tan (max (sin (asin (sin 5))) (round (max 2 (asin (asin (floor (floor (round X)))))))))))) (asin (round (max 2 (hypot (max 2 (asin (round (round (floor (round (round (toDegrees (expm1 5))))))))) (min 1 X)))))))))) X)) X)))) (* (min (- 3 X) (toDegrees 5)) (floor (floor (max (round (max (floor (round (round X))) (floor (max (floor 5) (ceil 4))))) (floor (floor (floor (max (floor (max (floor 5) (* (tan X) (floor (floor (sin (ceil (sin 5)))))))) (round (max 2 (asin (ceil 2)))))))))))))) (- (tan (abs (log (exp 3)))) (- (floor (floor (max (sin (asin (sin 5))) (floor (max (floor (- (asin (tan (floor 3))) X)) (asin (- (asin (- (max 2 (* (* (tan X) (floor (floor 5))) (ceil (round (floor (round (max (sin 5) (round X)))))))) X)) (- (floor (max (floor (max (floor (floor (floor (floor (- (asin (floor (- (floor 5) X))) (min (sqrt 5) (- (asin (floor (- (floor 5) X))) X))))))) (max (floor (round (round (sin (round X))))) (floor (max (floor 5) (ceil 4)))))) (asin (ceil 2)))) X)))))))) X))) (min (sqrt 5) (sin (floor (floor 5))))) (asin (min (max (hypot (round (min (round (hypot (asin 4) (* 4 5))) (sin (hypot (exp X) (atan 5))))) (* 4 (asin 5))) (floor (tan X))) (asin (- (asin (floor 1)) (asin (max 2 (- (max 2 (asin (ceil (cbrt (atan 5))))) X))))))))) (max (* (max (- (max (floor (min (cos (max (floor 5) (tan (floor (floor (- (* (tan X) (floor (floor 5))) X)))))) 5)) (asin (- (* (tan X) (- 1 2)) (max (- (round (- (max (min (cos (max (floor 5) (tan (floor (floor (- (floor 5) (* 4 5))))))) (floor (min (cos (max (floor 5) (tan (floor (floor (- (floor 5) X)))))) 5))) (asin (ceil 2))) X)) X) (- (* (- (round (- X X)) X) (- 1 2)) 2))))) X) (asin (ceil (round X)))) (max (max (max (sin 5) (- (max (- (floor (max (ulp (sqrt (min (sqrt 5) (sin (floor (floor 5)))))) (log1p (ulp X)))) X) (asin (exp (asin (* (- (floor 5) (* (asin (* (tan X) (asin (ceil (min (round X) (ceil 2)))))) (asin (ceil (min (- (floor (- (asin (floor (max (floor 5) (asin (exp (sin (max (sin 5) (floor (tan X))))))))) (max (asin (ceil 2)) (asin (ceil (* (* (tan X) (floor (floor 5))) (ceil (round (floor (round (max (sin 5) (round X)))))))))))) (min (round (asin (ceil (floor (floor 5))))) (ceil 2))) (ceil 2)))))) (asin (ceil (min (- (floor (- (asin (floor (* (tan X) (floor (floor 5))))) (round X))) (min (round (asin (ceil 2))) (ceil 2))) (hypot (max 2 (tan X)) (max (hypot (max 2 (tan (sqrt 5))) (round (hypot (max 2 (asin (max 2 (tan X)))) (* 4 5)))) (sqrt (log1p (rint X))))))))))))) (max (* (* (tan X) (asin (+ (round 2) (log 1)))) (max (sin (max (sin 5) (round (max 2 (asin (ceil (max (sin 5) (round (max (+ 3 2) (asin (ceil 2))))))))))) (signum (max (sin (max (floor (asin (tan (asin (* (* (* (tan (round (tan (asin (tan X))))) (floor (floor (sin (floor 5))))) (asin (* (* (tan (round (tan (asin (tan X))))) (floor (floor (sin (floor 5))))) (max (sin (max (sin 5) (round (max 2 (round (max 2 (asin (ceil 2)))))))) (min 1 X))))) (log (ceil (tan (abs (log (exp 3))))))))))) (* (* (round (max (max (sin (max (sin 5) (round (max 2 (asin (ceil (cbrt (atan 5)))))))) (round (max 2 (asin (ceil 2))))) (hypot (max (- (max 2 (sin (max 2 (asin (* (tan (floor 5)) (floor (floor 5))))))) X) (sin (max 2 (asin (* (tan (floor 5)) (floor (floor 5))))))) (ceil (hypot (max 2 (sin (max 2 (asin (* (tan (floor 5)) (floor (floor 5))))))) (asin (asin (max (sin (max (ceil 2) (round (max 2 (asin (ceil 2)))))) (asin (floor 5)))))))))) (max (max (floor (* (tan X) (+ (floor (+ (round (ceil (sin 5))) (log (asin 5)))) (log (asin 5))))) (ceil 4)) (* (- (* (* (* (tan X) (asin (asin (min (sqrt (max (floor (floor (ceil 2))) (asin (ceil 2)))) (sin (floor (floor 5))))))) (asin (- (signum (sinh (* (tan X) (sinh 4)))) X))) (asin (ceil (min (round (min (min (floor 4) (acos 4)) (sin (hypot (exp X) (atan 5))))) (sin (max (sin 5) (round (max (asin (max 2 (asin (ceil 2)))) (asin (ceil (log (ceil 2)))))))))))) X) (asin (exp (asin (ceil (min (round (round (round X))) (sin (max (sin 5) (round (max 2 (asin (ceil 2)))))))))))))) (floor (floor (- (floor 5) (hypot (- (floor 5) X) (floor 5)))))))) (asin (max (sin (max (sin 5) (round (max 2 (asin (ceil 2)))))) (asin (ceil 2)))))))) (sin (max (* (* (tan X) (asin (+ (round 2) (log 1)))) (max (sin (max (sin 5) (* (tan X) (floor (ceil (floor (floor 5))))))) (asin (asin (asin (max (min (max (sin (max (max 2 (asin (ceil 2))) (round (max 2 (asin (ceil 2)))))) (asin (floor 5))) (sin (* (sin (max (asin (max (asin (ceil 2)) (round (max 2 (asin (ceil 2)))))) (round (max (sqrt (max (asin (max 2 (asin (ceil (+ (round 2) (ceil 2)))))) (asin (ceil 2)))) (asin (ceil 2)))))) 5))) (asin (floor 5)))))))) (asin (ceil (asin 5)))))))) (asin (- (asin (floor (- (round (- (asin (- (asin (round (asin (floor 1)))) (- (asin 5) X))) (round (max (* (hypot (* 4 5) (* 4 5)) 5) (asin (ceil (max 2 (ceil 2)))))))) (round (max (* 4 5) (ceil 2)))))) (asin (- (asin (floor (- (* (- (round (- (asin (- (asin (round (asin (floor 1)))) (- (asin 5) X))) (round (max (* (hypot (* 4 5) (* 4 5)) 5) (asin (ceil (max 2 (ceil 2)))))))) (round (max (* 4 5) (ceil 2)))) (asin (+ (floor (+ (round 2) (log 1))) (log 1)))) (round (max (sin (max (* 4 5) (ceil 2))) (ceil 2)))))) (- (max (min (cos (max (floor (exp (floor 5))) (tan X))) 5) (asin (ceil 2))) X)))))) (* (* (* (floor (* (tan X) (* (sin (ulp (sqrt (min (sqrt 5) (sin (floor (floor (ceil (floor 5))))))))) (floor (floor (sin (max (asin (min (sqrt 5) (sin (floor (floor 5))))) (log10 (asin (ceil 2)))))))))) (* (sin (ulp (sqrt (min (sqrt 5) (sin (floor (floor (ceil (floor 5))))))))) (floor (floor (sin (max (asin (min (sqrt (sin (sqrt (* (asin (floor (floor (floor (* (tan X) (+ (round 2) (log (asin (sin (asin 5)))))))))) (asin (ceil (min (round (round (max (sin 5) (round (asin (floor (log (exp 3)))))))) (sin (max (sin 5) (ulp (cos X))))))))))) (sin (floor (floor 5))))) (log10 (asin (ceil 2))))))))) (asin 5)) (asin (ceil (min (round (round (round (round (round X))))) (sin (max (asin (round (max 2 (hypot (max 2 (tan X)) (max (hypot (max 2 (asin (max 2 (tan X)))) (* 4 5)) (sqrt (log1p (rint X)))))))) (round (max 2 (asin (ceil (ceil 2))))))))))))) (asin (* 4 5)))) X)) X) (- (asin (- (asin (asin (tan (hypot 3 (- (log10 (* (tan X) (floor (floor 5)))) X))))) (max (- (round (- (max (- (max (floor (floor 5)) (asin (floor (floor (- (max (signum X) (floor (floor 5))) (ceil (- (floor 5) X))))))) X) (asin (ceil 2))) X)) X) (sin (max (- (round (- (max (- (max (floor (floor 5)) (asin (asin (round (max 2 (hypot (max 2 (asin (max 2 (asin (round (round (round (ceil (round X))))))))) (min 1 X))))))) X) (asin (ceil 2))) X)) X) (- (floor (- (asin (floor (max (round (asin (floor (* (min (- 3 X) (toDegrees 5)) (- (log10 (* (tan X) (floor (floor (asin (ceil (cos X))))))) (hypot (tan 2) (hypot 3 X))))))) (asin (round (asin (floor (max (floor (* (hypot (asin 4) 2) (max (hypot (asin (tan (asin (ceil (asin (max (floor (round (round X))) (floor (max (floor 5) (ceil 4))))))))) (* (log (ceil (tan (abs (log (exp 3)))))) 5)) (hypot (max (hypot (asin (tan (asin (ceil (asin (max (floor (round (round X))) (floor (max (floor 5) (ceil 4))))))))) (* (log (ceil (tan (abs (log (exp 3)))))) 5)) (* (tan (exp 3)) (floor (floor 5)))) (ceil (hypot (max 2 (sin (max 2 (asin (* (tan (floor 5)) (floor (floor 5))))))) (asin (asin (max (sin (max (ceil 2) (round (max 2 (asin (ceil 2)))))) (asin (floor 5))))))))))) (tan X))))))))) X)) (round (* (round X) (asin 5))))))))) (max (- (round (- (max (min (cos (max (floor 5) (tan (floor (max (round (asin (floor (floor 5)))) (asin (exp (sin 5)))))))) 5) (asin (ceil 2))) X)) X) (- (floor (- (floor (max (round (asin (round (asin (- (asin (floor (floor 5))) (max (sin 5) (round (max 2 (asin (ceil (cbrt (atan 5)))))))))))) (asin (exp (asin (* (tan (floor (tan X))) (asin (ceil (+ (round 2) (round (asin (- (asin (floor 1)) (hypot (hypot (floor (- (asin (floor (max (floor (round (round X))) (floor (max 2 (asin (asin (floor 5)))))))) X)) 4) (asin 1)))))))))))))) (- (* (round (round X)) (max (expm1 (max (* (floor (ceil (floor (* (max (- (max 2 (asin (ceil 2))) X) (asin (ceil 2))) (max (hypot (max (sin (max (sin 5) (round (max 2 (asin (ceil (cbrt (atan 5)))))))) (round (max 2 (asin (ceil 2))))) (max (hypot (max (sin (max (sin 5) (round (max 2 (* (exp 5) (asin 5)))))) (round (max (round (max 2 (asin (ceil 2)))) (asin (ceil 2))))) (* 4 5)) (min 1 X))) (floor 5)))))) (max (floor (asin (max 2 (asin (tan (asin (* (* (* (tan X) (cos (tan X))) (max (sin (max (sin 5) (round (max 2 (asin (ceil (cbrt (atan 5)))))))) (min 1 X))) (max (sin 5) (* (* (* (tan X) (cos (tan X))) (max (sin (max (sin 5) (round (max 2 (asin (ceil (cbrt (atan 5)))))))) (* (max (sin (max (sin 5) (round (max 2 (asin (ceil (cbrt (atan 5)))))))) (min 1 X)) (floor (* (tan X) (floor (max (floor (floor 5)) (asin (ceil (floor (ceil (round (ceil 2))))))))))))) (log (ceil (max (asin (ceil (cos X))) (ceil (tan (abs (log (exp (max 2 (exp 3))))))))))))))))))) (* (* (asin (ceil 2)) (max (max (floor 5) (ceil 4)) (* (- (rint (cbrt 5)) X) (asin (ceil (floor (max (floor (max (floor 5) (* (tan X) (floor (floor (sin (ceil (sin 5)))))))) (round (max 2 (max (max 2 (asin (ceil 2))) (asin (ceil 2)))))))))))) (asin 4)))) (floor (max (* (floor (* (max (- (max 2 (asin (sin (max (sin 5) (round (max 2 (asin (asin (+ (round 2) (log (sin (log 1)))))))))))) (max (sin (asin (sin 5))) (- (max 2 (asin (sin (max (sin 5) (round (max 2 (asin (asin (+ (round 2) (log (sin (log 1)))))))))))) X))) (asin (ceil 2))) (max (hypot (max (sin (max (sin 5) (round (max (round (toDegrees (expm1 5))) (asin (ceil (cbrt (atan 5)))))))) (round (max 2 (asin (ceil 2))))) (* 4 5)) (floor 5)))) (max (floor (asin (round (- (asin (tan (floor 3))) X)))) (* (* (asin (ceil 2)) (max (max (floor 5) (ceil (max (floor 5) (ceil 4)))) (ceil (floor (ceil (round (ceil 2))))))) (asin 4)))) (asin (ceil 2)))))) (asin (ceil 2)))) (asin (max (asin (asin (asin (floor 5)))) (asin (ceil 2))))))) (- (* (floor (max (floor (max (sin 5) (floor (floor 5)))) (max (* (tan X) (max (- (asin (- (- (asin 5) (- (floor (- (asin 5) (tan 1))) (- (floor (sin (ceil (sin (sqrt (sin 5)))))) (round (floor (round X)))))) (- (floor (- (asin (* 4 (asin (floor (max (round (asin (floor (floor 5)))) (asin (exp (sin 5)))))))) (hypot (* 4 5) (* 4 5)))) (round X)))) (- (floor (- (asin (floor (max (round (asin (floor (floor (sin (max (sin 5) (round (max 2 (- (max 2 (asin (ceil 2))) (max 2 (asin (ceil 2)))))))))))) (asin (exp (sin 5)))))) (max (asin (ceil 2)) (asin (ceil (toDegrees (ceil 4))))))) (round X))) (cbrt (sinh X)))) (asin (hypot (exp 5) (atan 5)))))) (max (* (ceil 2) (max (floor (asin (* (* (* (tan X) (floor (floor 5))) (exp (* (* (tan X) (floor (floor 5))) (floor 5)))) (floor (floor (ceil (* (* (tan (- 3 (tan X))) (floor (* (tan X) (floor (* (tan X) (floor (max (floor (floor 5)) (asin (ceil (floor (ceil (round (ceil 2))))))))))))) (- 1 2)))))))) (* (tan X) (floor (floor 5))))) (asin (ceil 2)))) (- (max (floor (ceil (asin (ceil (floor (asin (asin (tan (asin (tan X)))))))))) (asin (- 1 2))) X)))))) (min (round (- (round (* (floor (max (signum X) (floor (floor 5)))) (max (* (floor (* (hypot (* 4 5) (* 4 5)) (floor (* (max (floor (max 2 (asin (sinh (* (* (asin (* (* 5 (max (floor (max 2 (asin (- (asin (ceil 2)) X)))) (asin (- (asin (ceil (min (round (asin (ceil 2))) (ceil 2)))) X)))) (asin (ceil (min (round X) (sin (asin (floor (tan X))))))))) (asin (ceil (min (round X) (sin (asin (floor (tan X)))))))) X))))) (floor 5)) (max X (* (tan X) (floor (* (tan X) (floor (floor 5)))))))))) (max (floor (asin (asin (- (asin (floor (asin (floor (asin (ceil 2)))))) (asin (max (expm1 (floor 2)) (asin (ceil 2)))))))) (* (max (asin (asin (floor (max (floor (floor (ceil 2))) (asin (floor (- (floor 5) X))))))) (* (tan (sin (max (asin (ceil (max (sin 5) (round (max (max (max (+ 3 2) (asin (ceil 2))) (* (- (rint (cbrt 5)) X) (asin (ceil (floor (max (floor (max (floor 5) (* (tan X) (floor (floor (sin (ceil (sin 5)))))))) (round (max 2 (max (max 2 (asin (ceil 2))) (asin (ceil 2))))))))))) (asin (ceil 2))))))) (max (round (asin (round (round (round (asin (* (asin (floor (floor (floor (* (tan (round (max 2 (asin (ceil 2))))) (+ (round 2) (log (asin (sin (asin 5)))))))))) (asin (ceil (min (round (round (ceil (round (max (sin 5) (round (max 2 (asin (ceil 2))))))))) (sin (max (sin 5) (ulp (cos X)))))))))))))) (max (asin (ceil (cos X))) (round (max 2 (asin (ceil 2))))))))) (floor (floor (- (floor 5) X))))) (floor (floor 5))))) (max (- (- (floor (sin 5)) X) (- (max (sin 5) (round (max 2 (asin (- (asin (ceil 2)) X))))) X)) (round (asin (floor (asin (min (asin (min (floor (ceil (floor (asin (hypot (exp X) (asin (asin (tan (ceil (tan X)))))))))) (asin (max (floor (max 2 (asin (- (asin (ceil 2)) (asin (cos 1)))))) (asin (- (asin (ceil 2)) X)))))) (asin (floor (max (max (floor (max (cos (sin 3)) (max (* (tan (max (floor (- (floor 5) X)) (ceil 4))) (floor (floor 5))) (- (floor (- (asin 5) (asin (ceil 2)))) (asin 4))))) (max (* (tan (max (floor 5) (ceil 4))) (floor (floor 5))) (- (floor (- (asin 5) (asin (ceil 2)))) (asin 4)))) (floor (floor (sin (floor 5)))))))))))))))) X)) (sin (max (sin (exp (sqrt 5))) (sin (max (sin (ulp (sqrt (min (sqrt 5) (sin (floor (floor (ceil (floor 5))))))))) (round (max 2 (max (max (tan (max 2 (- (max (- (floor (max (round (floor (max (round (round (round (asin (floor (tan (max (sin 5) (sin (max (sin 5) (max (max (sin 5) (round (max 2 (asin (ceil 2))))) (sqrt (log1p (rint X))))))))))))) (asin (ulp (asin 1)))))) (- (max (round (floor (- (asin (floor (max (floor (round (round X))) (floor (max (floor 5) (ceil 4)))))) X))) (asin (ceil 2))) (- 1 2)))) (tan X)) (- (asin (floor 1)) (- (asin (- 1 2)) X))) (max 2 (asin (ceil 2)))))) (- (max (- (floor (max (round (floor (max (round (floor (max (round (round (round (asin (floor (tan (max (sin 5) (sin (max (sin 5) (round (max 2 (asin (ceil 2))))))))))))) (asin (round (max 2 (hypot (max 2 (sin (exp X))) (ceil (hypot (max (round X) (sin (max 2 (asin (min (round (round (round X))) (sin (max (sin 5) (log1p (rint X))))))))) (asin (asin (max (sin (max (max 2 (asin (ceil 2))) (round (max 2 (asin (ceil 2)))))) (asin (floor 5)))))))))))))) (- (max (round (floor (- (asin (floor (max (floor (round (round X))) (floor (max (floor 5) (ceil 4)))))) X))) (asin (max (round (floor (- (asin (floor (max (floor (round (round X))) (floor (max (floor 5) (ceil 4)))))) X))) (max 2 (max (round (floor (- (asin (floor (max (floor (round (round X))) (floor (max (floor 5) (ceil 4)))))) X))) (asin (ceil (* (min (- 3 X) (toDegrees 5)) (ceil (signum (log 4))))))))))) (- (+ (IEEEremainder 4 X) (min 4 5)) (asin (- 1 2))))))) (- (max (round (max 2 (asin (ceil 2)))) (asin (ceil 2))) (- 1 2)))) X) (- (asin (floor 1)) (- (asin (max (asin (asin (floor (max (floor (floor (ceil 2))) (asin (ceil 2)))))) (asin 5))) X))) (max 2 (asin (ceil 2))))) (asin (- (asin (floor (- (min (round X) (sin (asin (floor (tan (max (tan (sin (max 2 (log10 (asin (ceil 2)))))) (round (max 2 (asin (asin (floor (floor (round X))))))))))))) (round (max (* (max (floor (floor 5)) (asin (floor (asin (floor (floor (- (floor 5) X))))))) (asin (ulp 3))) (asin (ceil 2))))))) (- (floor (floor (- (asin (floor (asin (ceil 2)))) X))) (asin (- (floor (floor (- (asin (floor (max (round (+ (round 2) (round (asin (- (asin (floor 1)) (floor (max 2 (asin (ceil 2))))))))) (asin (* (* (* (tan X) (floor (floor 5))) (exp (* (* (tan X) (floor (floor 5))) (floor 5)))) (asin 5)))))) X))) (* (- (floor (floor (- (asin (floor (max (round (asin (round (+ (round 2) (round (asin (- (asin (floor (max (sin 5) (round (max 2 (IEEEremainder (sinh 1) (signum 2))))))) (floor (- (asin (floor 1)) (log (- (asin (floor 5)) (asin (ceil 2))))))))))))) (asin (* (exp 5) (asin 5)))))) X))) X) 5))))))))))))))) (asin (ceil (asin (floor (log (exp 3)))))))))",
				//hints functions
				"(* X (* (* X (round (+ (+ 1 (+ (+ (/ (/ (- (exp 2) X) (/ (/ (- (exp 2) X) (/ 5 (/ (/ 5 2) 1))) (/ 5 2))) (/ 5 (+ (/ (+ (/ (+ 1 (+ (+ (/ (round (- 4 5)) (pow (exp (pow (- (exp 2) (pow 3 (exp (+ 5 X)))) 2)) (/ (/ (exp (/ (/ (- (* (- (/ (- (exp 2) (/ (* (/ (/ (log 2) 4) (/ 5 (* (log (/ (- (exp 2) X) (/ 5 (/ (- (exp 2) X) (log 2))))) (/ (* 1 3) 2)))) (+ (- 2 2) X)) (/ (* (/ 5 (- (exp (/ (/ (* (/ (log 2) 4) (/ (/ (* (log 2) 3) 1) 5)) (/ (/ 5 2) 2)) 2)) X)) 3) (- (exp (/ (/ (* (/ (log 2) 4) (/ (/ (* (log 2) 3) 1) 5)) (/ (/ 5 2) 2)) 2)) X)))) (/ (/ 5 (/ 5 2)) 2)) (/ (* (/ (/ (log 2) 4) (/ 5 (* (log (/ (- (exp 2) X) (/ 5 (/ (pow (/ (+ (/ (/ (/ 5 2) (/ (/ (exp (/ (exp 2) 2)) (/ 5 (/ (/ 5 (* (+ 1 (* (log 2) (- (exp 2) X))) (/ 1 2))) 1))) (/ 5 2))) (/ 5 (+ (exp (+ (/ (/ (- (exp 2) X) (/ (+ 5 (/ (* (+ 2 5) (/ 1 5)) (/ 5 (* (log 2) (/ (/ 5 (/ 5 2)) 2))))) (/ (- (exp 2) X) (/ (+ 5 (/ (* (+ 2 5) (/ 1 5)) (/ 5 (* (log 2) (/ (/ 5 (/ 5 2)) (+ 1 (/ (/ 5 (/ 5 2)) 2))))))) (/ 5 (* (log 2) (/ (/ 5 (/ 5 2)) 2))))))) 2) X)) X))) X) 2) (/ (- (exp 2) X) (log 2))) (log 2))))) (/ (* (/ (log 2) 4) (/ (/ (* (log 2) 3) 1) 5)) (* (log (/ (- (exp 2) X) (/ 5 (/ (- (exp 2) X) (log 2))))) (/ (* 1 3) 2)))))) (+ (- 2 2) X)) (/ (* (/ 5 (- (exp (/ (/ (* (/ (log 2) 4) (/ (/ (* (log 2) 3) 1) 5)) (/ (/ 5 2) 2)) 2)) X)) 3) (- (/ (* (/ 5 (- (exp (/ (/ (* (/ (log 2) 4) (/ (/ (* (log 2) 3) 1) 5)) (/ (/ 5 2) 2)) 2)) X)) 3) (- (exp (/ (/ (* (/ (log 2) 4) (/ (/ (* (log 2) (/ 5 2)) 1) 5)) (/ (/ 5 2) 2)) 2)) X)) X)))) (+ (/ (+ 1 (* (log 2) (+ (/ (/ (- (exp 2) X) (/ 5 2)) 2) X))) (/ (- (exp (pow (/ (+ (/ (/ (/ 5 2) (/ (/ (exp (/ (/ 5 (/ (exp 2) 2)) 2)) (/ 5 (/ (/ 5 (* (+ 1 (* (log 2) (- (exp 2) X))) (/ 1 2))) 1))) (/ 5 2))) (/ 5 (+ (exp (+ (/ (/ (- (exp 2) X) (/ (* (+ 2 5) (/ 1 5)) (/ 5 (* (log 2) (/ 5 2))))) 2) X)) X))) X) 2) X)) X) (/ (+ 1 (* (log 2) 3)) 2))) X)) X) (/ 5 2)) (exp (pow (/ (+ (/ (/ (/ 5 2) (/ (/ (exp (/ (exp 2) (/ (exp (/ (exp 2) (+ 1 (* (log 2) (+ 1 4))))) (/ (exp 2) 2)))) (/ 5 (/ (/ 5 (* (/ (* (log 2) (/ 1 2)) 2) (/ (* (/ (* (log 2) (/ 1 2)) 2) (/ 1 2)) (/ 5 (* (exp (* (log 2) (round (- 4 5)))) (round (- 4 5))))))) 1))) (/ 5 2))) (/ 5 (+ (/ (/ (- (exp (/ (exp 2) (+ (/ (exp 2) 2) X))) X) (/ (/ (/ (* (+ 2 5) (/ (- (exp 2) X) (/ (/ (- (exp 2) X) (/ 5 (/ (/ (/ (/ 5 2) (/ 3 (/ 5 (/ 3 (- (- X X) (- 2 2)))))) 2) 1))) (/ 5 2)))) (/ (/ (/ (- (* (- (exp 2) (/ (* (/ (/ (log 2) 4) (/ 5 (* (log (/ (- (exp 2) X) (/ 5 (/ (- (exp 2) X) (log 2))))) (/ (* 1 3) 2)))) (/ 3 1)) (/ 5 (- (log (- (exp (/ (/ (* (/ (log (- (exp 2) X)) 4) (/ 1 5)) (/ (/ 5 2) 2)) 2)) X)) X)))) (+ (/ (+ (/ (+ (- X 3) (* (log 2) 3)) 2) (- 4 5)) (/ (+ (- (exp (+ 1 (* (log 2) (- (exp (/ (/ (- (exp 2) X) (/ 5 (/ (+ (- 2 2) X) 1))) (* (log (/ 5 2)) 3))) X)))) X) X) (/ (+ 1 (* (log (/ (log (- (exp 2) X)) 4)) 3)) 2))) X)) X) (/ (/ (- (* (- (exp 2) (/ (* (/ (/ (log 2) 4) (/ 5 (* (log (/ (- (exp 2) X) (/ 5 (/ (- (exp (exp (exp 2))) X) (log 2))))) (/ (* 1 3) 2)))) (/ 3 1)) (/ 5 (- (exp (/ (/ (* (/ (log (- (exp 2) X)) 4) (/ 1 5)) (/ (/ 5 2) 2)) 2)) X)))) (+ (/ (+ (/ (+ 1 (* (log 2) 3)) 2) (- 4 5)) (/ (+ (- (exp (+ 1 (* (log (log 2)) (- (exp (/ (/ (- (exp 2) X) (/ 5 (/ (+ (- 2 2) X) 1))) (/ 5 2))) X)))) X) X) (/ (+ 1 (* (log (/ 5 2)) 3)) 2))) X)) X) (/ 5 2)) (* (log (/ (- (exp 2) X) (/ 5 (/ (- (exp 2) X) (log 2))))) (/ (* 1 3) 2)))) (/ 5 (/ (/ (log 2) 4) (/ 5 (/ (/ 5 (* (log 2) (/ 5 2))) (+ (/ 5 2) X)))))) (* (log 2) (/ 5 2)))) (+ (/ (- (exp (+ 1 (* (log (+ (/ (/ (/ 5 2) (/ (/ (- (+ (/ (+ 1 (* (log (* (log 3) 3)) (exp 5))) 2) X) X) (/ (- 2 (/ (* (/ (log 2) 4) (/ 1 5)) (/ 5 (- 4 (/ 2 (* (log 2) (/ 5 2))))))) (/ (/ 5 (* (log 2) (/ 1 2))) (- (/ (/ 5 (* (log 2) (/ 1 2))) (/ (/ (/ 5 (* (log 2) (/ 1 2))) 1) 2)) X)))) (- (/ (/ (- (+ (/ (- (log 2) X) 2) X) X) (/ (/ (- (exp 2) X) (- 2 2)) (/ (/ (log 2) 4) (/ (/ 5 (* (+ 1 (* (log 2) (- (exp 2) X))) (/ 1 2))) 1)))) (/ 5 2)) (round (- (exp (/ (* 1 3) 2)) (/ (/ (+ 1 (* (log 2) (- (exp 2) (+ 5 X)))) (/ 3 (/ 5 2))) (+ (- (exp 2) (+ 5 X)) X))))))) (/ 5 (* (log 2) (/ 5 2)))) X)) (/ (+ 1 (+ (+ (+ (+ (/ 5 (pow (exp (log (exp (pow 3 2)))) (/ (/ (exp (/ (- (exp 2) X) (/ 5 2))) 2) 1))) X) X) X) (- (exp 2) X))) 2)))) (* (log 2) 3)) (exp 2)) (/ (+ (/ (- (exp (+ (/ (- (exp 2) X) (exp 2)) (* (log 2) (- (+ 4 4) X)))) X) (/ 5 (/ (/ 5 2) 1))) (* (+ (/ (- (exp (+ 1 (* (- (exp 2) (pow 3 2)) (- (round (- (exp 2) (/ (/ (+ 1 (* (log 2) (* (log 2) 3))) (/ 3 (round (/ 3 1)))) (+ (- (exp (log 5)) (+ 5 X)) X)))) X)))) X) (/ 5 (/ (/ (* (* (log 2) (/ 5 2)) 3) 2) 1))) X) (/ (- (exp 2) X) (/ (/ (- (exp 2) X) (exp 2)) (/ 5 2))))) (/ 3 (/ 5 2))))) (/ (/ (/ (- (* (- (/ (log 2) 4) (/ (* (/ (/ (log 2) 4) (/ 5 (* (log (/ (- (exp 2) X) (/ 5 (/ (- (exp 2) X) (log 2))))) (/ (* 1 3) 2)))) (/ 3 1)) (/ 5 (- (exp (/ (/ (* (/ (log (- (exp 2) X)) 4) (/ 1 5)) (/ (/ 5 2) 2)) 2)) X)))) (+ (/ (+ (/ (+ 1 (* (log 2) 3)) 2) (- 4 5)) (/ (+ (- (exp (+ 1 (* (log 2) (- (exp (/ (/ (- (exp 2) X) (/ 5 (/ (+ 4 X) 1))) (* (log (/ 5 2)) 3))) X)))) X) X) (/ (+ 1 (* (log (/ 5 2)) 3)) 2))) X)) X) (/ (/ (- (* (- (exp 2) (/ (* (/ (/ (log 2) 4) (/ 5 (* (log (/ (- (exp 2) X) (/ 5 (log (/ 5 (/ (- (exp 2) X) (log 2))))))) (/ (* 1 3) 2)))) (/ 3 1)) (/ 5 (- (exp (/ (/ (* (/ (log (- (exp 2) X)) 4) (/ 1 5)) (/ (/ 5 2) 2)) 2)) X)))) (/ 5 2)) X) (/ 5 2)) (* (log (/ (- (exp 2) X) (/ 5 (/ (- (exp 2) X) (log 2))))) (/ (* 1 3) 2)))) (/ 5 (/ (/ (log 2) 4) (/ 5 (/ (/ 5 (* (log 2) (/ 5 2))) (+ (- (exp 2) (+ 5 X)) X)))))) (* (log 2) (/ 5 2))))) 2) X))) X) 2) (/ 5 2))))) 2) 1))) X) X)) 2) (* (log 2) 3)) 2) X))) X) X)) (/ (+ (+ (/ 3 (/ 5 2)) (+ (+ (/ (/ (- (exp 2) X) (/ (/ (- (exp 2) X) (/ 5 (/ (+ (- 2 2) X) 1))) (/ 5 2))) (/ 5 (+ (/ (+ (/ (+ 1 (+ (+ (/ 5 (pow (+ 1 (* (log 1) 5)) (/ (/ (- (exp 2) X) (/ (- (exp 2) X) (/ (exp (log (exp (pow 3 2)))) (/ (/ (- (exp 2) (/ (- (exp 2) (round (- (exp 2) (/ (/ (+ 1 (* (log 2) 3)) (/ (/ (- (exp 2) (* (* (/ (* (log 2) 3) 1) 3) (- (exp 2) (round (- (exp 2) (/ (/ (+ 1 (- 2 (+ 1 (* (log 2) 3)))) (/ (* (/ (* (+ 2 5) (/ 1 5)) (/ 5 (/ (/ 5 (/ (/ (* (/ (log 2) 4) (/ 1 5)) (/ 5 (- 4 (/ 2 (* (log 2) (/ 5 2)))))) 5)) 5))) (+ (log (+ (- 2 2) X)) X)) (/ 5 2))) (+ (- (exp 2) (+ 5 X)) X))))))) (/ 3 (- (- X X) (* (/ (+ 1 (+ (/ (/ (exp 2) (/ 5 (* (* (/ (* (log 2) 3) 1) 3) (/ 5 2)))) (log (/ (/ (- (exp 2) X) (/ 5 2)) 2))) X)) 2) (+ (* (- (exp 2) (* 1 3)) 3) (* (log 2) (/ (+ 1 (* (log (/ (+ (- 2 2) (/ (+ (- 2 2) (* (/ (* (+ 2 5) (/ 1 5)) (/ 5 (* (/ (* (log 2) (/ 1 2)) 2) (/ 1 2)))) (+ (- 2 2) X))) 2)) (log 2))) 3)) 2))))))) (/ 5 2))) (exp (/ (/ (+ 1 (* (log 2) (* (log 2) (* (log 2) 3)))) (/ (/ (- (exp 2) (* (* (/ (* (log 2) 3) 1) 3) (- (exp 2) (round (- (exp 2) (/ (/ (+ 1 (- 2 (+ 1 (* (log 2) 3)))) (/ (* (/ (* (+ 2 5) (/ 1 5)) (/ 5 (/ (/ 5 (/ 1 5)) 5))) (+ (log (+ (- 2 2) X)) X)) (/ 5 2))) (+ (- (exp 2) (+ 5 X)) X))))))) (/ 3 (- (- X X) (* (/ (+ 1 (+ (/ (/ (exp 2) (- (exp 2) X)) (log (/ (- (exp 2) X) 2))) X)) 2) (+ (* (- (exp 2) (* 1 3)) 3) (* (log 2) 3)))))) (/ 5 2))) (+ (- (exp 2) (+ 5 X)) X))))))) (/ 5 2))) (/ 3 (- (- X (/ (- (exp 2) X) (/ 5 2))) (* 1 (+ (* 1 3) (* (log 2) (/ 5 (+ (/ (/ (- (exp 2) X) (/ 5 2)) 2) X)))))))) (/ 5 2))))) (/ 5 (+ (/ (+ (/ 5 (+ 1 (* (/ (* (+ 1 (/ (+ 1 (* (log 2) 3)) (/ 5 2))) (- (exp 2) (+ 5 X))) (/ (* (/ (round (/ (/ (- (exp (/ (exp 2) (/ (* (* 4 4) X) (/ 5 2)))) X) (/ 5 2)) (/ 5 (- (* (- (exp 2) (/ (* (/ (- 2 (/ (* (/ (log 2) 4) (exp 2)) (/ 5 (- (exp (/ 5 X)) (/ 5 (* (log 2) 4)))))) (/ 5 (- 4 (/ 5 (* (log 2) (/ 5 2)))))) (+ (- 2 2) X)) (/ 5 (* (log 2) (round (- 4 5)))))) (+ (/ (+ (round 5) (* (log (* (log (/ (+ (- 2 2) (/ (+ (- 2 2) (* (/ (* (+ 2 5) (/ 1 5)) (/ 5 (/ (/ 5 (/ 1 5)) 5))) (+ (log (+ (- 2 2) X)) X))) 2)) (log 2))) (- (+ 1 (- (* (log (/ (+ (/ (* (* (log 2) (/ 5 2)) 3) 2) (/ (+ (- 2 2) (* (/ (* (+ 2 5) (/ 1 5)) (/ 5 (/ (/ 5 (/ 1 5)) 5))) (+ (log (+ (- 2 2) X)) X))) 2)) (log 2))) 3) X)) X))) 3)) 2) X)) (round (- 4 5)))))) (/ 5 (/ (/ (/ (exp 2) (/ 5 (* (* (/ (* (log 2) 3) 1) 3) (/ 5 2)))) (log (/ (+ 1 (* (log (/ (pow (exp (log (exp (/ (exp (pow 3 2)) 2)))) (/ 5 (round (/ 3 4)))) (round (/ 3 4)))) 3)) 2))) (/ 5 (* (* (/ (* (log (/ (+ 1 (* (log 2) (* (log 2) 3))) (log 2))) 3) 1) 3) (/ (/ (/ (- (exp 2) X) (/ (/ (- (exp (pow 3 5)) (round (- (exp 2) (/ (/ (+ 1 (* (log 2) (* (log 2) 3))) (/ 3 (round (/ 3 1)))) (+ (- (exp 2) (+ 5 X)) X))))) (/ 3 (- (- X X) (* 1 (+ (* 1 3) (* (log 2) 3)))))) (/ 5 2))) (/ 5 2)) 2)))))) (+ (- 2 2) X)) (/ 5 (/ (+ 1 (* (log 2) (+ (* (* 1 (+ (* 1 3) (* (log 2) 3))) (/ (exp 2) (* (log 2) 3))) X))) (/ (- (+ (* 1 3) (* (log (- (exp 2) X)) 3)) X) (+ (/ (- (exp (+ 1 (* (log (+ (/ (/ (/ 5 2) (/ (/ (- (+ (/ (+ 1 (* (log (* (log 3) 3)) (exp 5))) 2) X) X) (/ (- 2 (/ (/ (+ (- 2 2) X) (/ (* (/ (log 2) 4) (/ (- (/ 1 5) 2) 5)) (/ 5 (- 4 (/ 2 (* (log 2) (/ 5 2))))))) (/ 5 (- 4 (/ 2 (* (log 2) (/ 5 2))))))) (/ (/ 5 (* (log 2) (/ (/ 5 2) 2))) 1))) (- (/ (/ (- (+ (/ (+ 1 (* (log 2) (exp 2))) 2) X) X) (/ (/ (+ 1 (/ (- (exp 2) X) (/ 5 2))) (/ 5 2)) (/ (/ 5 (* (log 2) (/ 1 2))) 1))) (/ 5 2)) (round (- (exp (/ (* 1 3) 2)) (/ (/ (+ (- (exp 2) (+ 1 (* (log 2) 3))) (* (log 2) 3)) (/ 3 (/ 5 2))) (+ (- (exp 2) (+ 5 X)) X))))))) (/ 5 (+ (/ (/ (- (exp 2) X) (/ 5 2)) 2) X))) X)) (/ (+ 1 (+ (+ (+ (+ (/ 5 (pow (exp (log (exp (pow 3 2)))) (/ (/ (exp (/ (- (exp 2) X) (/ 5 2))) 2) 1))) (/ (+ (/ 5 (pow (exp (log (exp (pow 3 2)))) (/ (/ (exp (/ (exp (/ (- (exp 2) X) (/ 5 2))) 2)) 2) 1))) X) (log 2))) X) X) (- (exp 2) X))) 2)))) X) (exp 2)) (/ (+ (/ (- (exp (+ 1 (* (log 2) (- (+ 4 4) X)))) X) (/ 5 (/ (/ 5 2) 1))) (* (+ (/ (- (exp (+ 1 (* (- (exp 2) (pow 3 2)) (- (round (/ 5 (round (- (exp 2) (/ (/ (+ 1 (* (log 2) (* (log 2) 3))) (/ 3 (round (/ 3 1)))) (+ (- (exp (log 5)) (+ 5 X)) X)))))) X)))) X) (/ 5 (/ (/ (* (* (log 2) (/ 5 2)) 3) 2) 1))) X) (/ (- (exp 2) X) (/ (/ (- (exp 2) X) (/ 5 (/ (/ 5 2) 1))) (/ 5 2))))) (/ 3 (/ 5 2))))))))) 3))) (* (/ (* (+ 1 (* (log 2) 3)) (- (exp 2) (+ 5 X))) (/ (* (/ (round (/ (/ (- (exp (/ (exp 2) (/ 3 (/ 5 2)))) X) (/ (- (exp 2) X) 2)) (/ 5 (- (* (- (exp 2) (/ (* (/ (- 2 (/ (log 2) (/ 5 (- 4 (/ 5 (* (log 2) 4)))))) (/ 5 (- 4 (/ 5 (* (log 2) (/ 5 2)))))) (+ (- 2 2) X)) (/ 5 (* (log 2) (round (- 4 5)))))) (+ (/ (+ (round 5) (* (log (* (* (log 2) (* (log 2) 3)) 3)) 3)) 2) X)) (round (- 4 5)))))) (/ 5 (/ (/ (/ (exp 2) (* 1 (/ (exp 2) (/ 5 (* (* (/ (* (log 2) 3) 1) 3) (/ 5 2)))))) (log (/ (+ 1 (* (log (/ 5 2)) 3)) 2))) (/ 5 (* (* (/ (* (log (/ (+ 1 (* (log 2) (* (log 2) 3))) (log 2))) 3) 1) 3) (/ (/ (/ (- (exp 2) X) (/ (/ (- (exp 2) (round (- (exp 2) (/ (/ (+ 1 (* (log 2) (* (log 2) 3))) (/ 3 (round (/ 3 1)))) (+ (- (exp 2) (+ 5 X)) X))))) (/ 3 (- (- X X) (* 1 (+ (* 1 3) (* (log (* (log 2) (/ 5 2))) 3)))))) (/ 5 2))) (/ 5 2)) 2)))))) (+ (- 2 2) X)) (/ 5 (/ (+ 1 (* (log 2) (+ (* (* 1 (+ (* 1 3) (* (log 2) 3))) (/ (exp 2) (* (log 2) 3))) X))) (/ (- (+ (* 1 3) (* (log (- (exp 2) X)) 3)) X) (+ (/ (- (exp (+ 1 (* (log (+ (/ (/ (/ 5 2) (/ (/ (- (+ (/ (+ 1 (* (log (* (log 2) 3)) (exp 5))) 2) X) X) (/ (- 2 (/ (+ 4 4) (/ 5 (- 4 (/ 2 (* (log 2) (/ 5 2))))))) (/ (/ 5 (* (log 2) (/ 1 2))) 1))) (/ 5 2))) (/ 5 (+ (/ (/ (- (exp 2) X) (* (/ (* (log 2) (/ 1 2)) 2) (/ 1 2))) 2) X))) X)) (/ (+ 1 (+ (+ (+ (+ (/ 5 (pow (exp (log (exp (pow 3 2)))) (/ (/ (exp (/ (- (exp 2) X) (/ 5 2))) 2) 1))) X) X) X) (- (exp 2) X))) 2)))) X) (exp 2)) (/ (+ (/ (- (exp (+ 1 (* (log 2) (+ (/ (/ (- (exp 2) X) (/ 5 2)) 2) X)))) X) (/ 5 (/ (/ 5 2) 1))) (* (+ (/ (- (exp (+ 1 (* (- (exp 2) (pow 3 2)) (- (round (- (exp 2) (/ (/ (+ 1 (* (log 2) (* (log 2) 3))) (/ 3 (round (/ 3 1)))) (+ (- (exp (log 5)) (+ 5 X)) X)))) X)))) X) (/ 5 (/ (/ (* (* (log 2) (/ 5 2)) 3) 2) 1))) X) (/ (- (exp 2) X) (/ (/ (- (exp 2) X) (/ 5 (/ (/ 5 2) 1))) (/ 5 2))))) (/ 3 (/ 5 2))))))))) 3)) 2) (round X)))))) (- (exp 2) (+ (log (* (log 3) (+ 1 (* (log 2) 3)))) X))) (+ (- 2 2) X))) 2) (* (log 2) 3)) 2) X))) X) X)) X) (+ (/ (/ (- (exp 2) X) (/ 5 2)) (/ (/ (/ (- (exp 2) X) (/ (/ (- (exp 2) (round (- (exp 2) (/ (/ (+ 1 (* (log 2) (* (log 2) 3))) (/ 3 (round (/ 3 1)))) (+ (- (exp 2) (+ 5 X)) X))))) (/ 3 (- (- X X) (* 1 (+ (* 1 3) (* (log 2) 3)))))) (/ 5 2))) (/ 5 (+ (/ (+ 1 (* (/ (* (log 2) (- (exp 2) (+ 5 X))) (/ (* (/ (round (/ (/ (- (exp 2) X) (/ 5 2)) (/ 5 (- (* (- (exp 2) (/ (* (/ (- (+ (/ (+ 1 (* (log (/ (+ (- 2 2) (/ (+ (- 2 2) (* (/ (* (+ 2 5) (/ 1 5)) (/ 5 (* (/ (* (log 2) (/ 1 2)) 2) (/ 1 2)))) (+ (- 2 2) X))) 2)) (log 2))) 3)) 2) X) (* 1 (+ (/ (+ (* 1 3) (* (log (- (exp 2) X)) 3)) 2) (* (log 2) 3)))) (/ (- (exp 2) X) (/ 5 2))) (+ (- 2 (+ (- 2 2) X)) X)) (/ 5 (* (exp (* (log 2) (round (- 4 5)))) (round (- 4 5)))))) (+ (/ (+ 1 (* (log (/ (+ (- 2 2) (/ (+ (- 2 2) (* (/ (* (+ 2 5) (/ 1 5)) (/ 5 (+ (/ (/ (- (exp 2) X) (/ 5 2)) 2) X))) (+ (- 2 2) X))) 2)) (log 2))) 3)) 2) X)) (round (- 4 5)))))) (/ 5 (/ (exp 2) (/ 5 (* (* (/ (* (log 2) 3) 1) 3) (/ 5 2)))))) (+ (- 2 2) X)) (/ 5 (/ (+ 1 (* (log 2) (+ (* (log 2) 3) X))) (/ (- (exp (/ (/ 5 2) 2)) X) (+ (/ (- (exp (+ 1 (* (log (+ (/ (/ (/ 5 2) (/ (/ (- (+ (/ (+ 1 (* (log 2) 3)) 2) X) X) (/ 5 (/ (/ 5 (* (log (/ 5 (/ (/ 5 2) 1))) (/ 1 2))) 1))) (/ 5 2))) (/ 5 (+ (/ (/ (- (exp 2) X) (/ 5 2)) 2) X))) X)) (/ (+ 1 (+ (+ (/ 5 (pow (exp (- (exp (log (exp (pow 3 2)))) (+ 5 X))) (/ (+ 1 (* (log 2) 3)) 1))) X) (- (exp 2) X))) 2)))) X) (/ 5 (/ (/ 5 2) 1))) (/ (+ (/ (- (exp (+ 1 (* (log 2) (- (exp 2) X)))) X) (/ 5 (/ (/ 5 2) 1))) X) (/ (/ (- (exp 2) 2) (/ 5 (/ (+ (- 2 2) X) 1))) (- (/ (/ (exp 2) (/ 5 (/ (+ (- 2 2) X) 1))) (/ 5 2)) X))))))))) 3)) 2) X))) (/ (+ 1 (* (log 2) 5)) (/ 5 2)))) (* (/ (* (log 2) 3) 1) 3)))))) (+ (+ (- (exp (log 5)) (+ 5 X)) X) X)))",
				"(min (min (+ (/ (* (* (min (+ (max (+ X 4) (+ (abs 2) 4)) 4) (- X (min X 1))) (abs 2)) X) (abs 2)) X) (- (+ (+ (+ (* (min (+ (min X (+ (min X (+ (abs 2) (abs (+ (abs 2) (min (+ (min (+ (+ (min X 4) (/ 3 (min 1 5))) (min (/ (* (sqrt (abs (sqrt 4))) (/ (max 4 (/ X 1)) 1)) (min X (+ (abs 2) 4))) (+ (abs 2) 4))) (+ (min X (min 1 (* (sqrt 4) (tan 4)))) 4)) (abs (+ (min (+ (+ (min X 4) (/ 3 (min 1 5))) (min (/ (* (sqrt (abs (sqrt 4))) (/ (max 4 (/ X 1)) 1)) (min X (+ (abs 2) 4))) (+ (abs 2) 4))) (+ (min X (min 1 (* (sqrt 4) (tan 4)))) 4)) 4))) X))))) (+ (min X 2) (max (/ 4 (max 4 (/ 1 (min (+ (max (+ X 4) (+ (abs 2) 4)) 4) (* (sqrt (* (/ (sqrt 4) (min (min (sqrt (min 1 (+ (min X (* X (tan (* X X)))) (min 1 (* (sqrt 4) (tan (max 4 X))))))) (+ (min X (/ 3 (max 4 X))) (min 1 (* (sqrt 4) (tan (max 4 X)))))) (* X (min (- (+ (min X (+ (min (+ (* 3 4) (sqrt 2)) (+ (+ (+ (abs 2) 4) (max (/ (max (/ 3 (max 4 (- 1 (max 3 4)))) X) (tan (+ (tan X) X))) X)) (abs 2))) (tan X))) 4) 3) (* X (tan (* X (- (* X X) (tan 2))))))))) X)) (abs 2)))))) X)))) 4) (* X (abs (sqrt (+ (* (- (* X (abs (sqrt (+ (min (+ (abs X) (sqrt (min X (sqrt (abs (abs (sqrt (abs (abs (+ (abs (sqrt (/ 1 (sqrt (abs 2))))) 4)))))))))) (* (sqrt 4) (sqrt 2))) (sqrt (min (- (tan 2) (min (* (min 2 2) (min (- (+ (min X (+ (min X (+ (abs 2) 4)) (tan X))) 4) 3) (* X (tan (* X X))))) 2)) (sqrt (abs (abs (+ (abs (abs (+ (min (max 4 (min (min (min (- (+ (min (/ (min X (abs 2)) (min X (+ (abs 2) 4))) (abs 2)) 4) 3) 5) (- 2 (min X (* (sqrt 4) (abs 2))))) (sqrt (/ 3 X)))) (min X (min (abs (min (+ (min (+ (abs 2) (min X (max (+ X 4) (min X (+ (abs 2) 4))))) (max (sqrt 4) 5)) 4) (max 4 (/ 1 (max 4 X))))) X))) 4))) 4)))))))))) (/ X 1)) (/ 1 (sqrt (/ 1 (+ (sqrt (+ (abs (min (abs (- (+ (min 1 (+ (min X (+ (min X (+ (+ (+ (abs 2) 4) (max (/ 3 (max 4 (- 1 (max 3 4)))) X)) (abs 2))) (tan X))) 4)) 4) 3)) (tan (/ (tan (min (abs (min 1 (abs (+ (min X (min (* (+ (* (+ (min (+ (abs 2) 4) (/ (* (sqrt 4) (/ X 1)) 1)) 4) (abs 2)) 4) (min X (sqrt (abs (abs (- (abs X) 3)))))) (sqrt (abs (abs (- (abs X) 3)))))) (min (+ (tan X) 4) X))))) (* (* (sqrt 4) (* (min (tan (min (min 1 (min X (min 1 5))) (+ (abs 2) 4))) (max 4 (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))))) X)) X))) (min (- (abs X) 3) 5))))) (tan (/ (min (min (min (- (* (* (min X 1) (sqrt (* (min (abs 2) 1) (max 5 (/ (min X (sqrt (max (+ X 4) (/ (sqrt 4) 3)))) (sqrt (/ (/ (max 4 X) (/ 1 (max (min (max 4 X) (max 4 (/ 1 (max 4 (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))))))) X))) (max 4 X)))))))) (- (abs (min X (min (+ (min (min (- (+ (min X (+ (* (min X 4) (+ (abs 2) (sqrt (+ (abs 2) 4)))) (sqrt (+ (abs 2) 4)))) 4) 3) 5) (+ (abs 2) 4)) 4) X))) 3)) 3) 5) (/ 1 (min (min (min X (min 1 (max 4 (min 1 (* (* (/ 1 3) (- 5 4)) (tan 4)))))) (* (sqrt 4) (tan 4))) (* (min (min 1 5) (max (/ 3 (max 4 (/ (+ (min X (min X (sqrt (abs (abs (abs 2)))))) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min 1 (* (sqrt (min (sqrt 4) (* (sqrt 4) (tan (max 4 X))))) (abs 2)))))) X)) (+ (* (+ (min (+ (abs 2) 4) (+ (min (+ (* (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) (* X (max 4 (/ 1 (max 4 X))))) (max 4 (/ 1 (max 4 X)))) 4) (/ 4 1)) X)) 4) X) (* (+ (* (+ (min (+ (abs 2) 4) (/ (* (sqrt (abs (sqrt (abs 2)))) (/ X 1)) 1)) (min (min 1 (min 1 5)) (max (/ 3 (max 4 (/ 1 (min 1 (* (sqrt 4) (abs 2)))))) X))) X) 4) (tan 4))))))) (+ (abs 2) (min (min (min (- (abs (min X (min (+ (min (+ (sqrt (+ (abs 2) (min (max (+ (abs 5) (tan 1)) X) (+ (abs 2) (min X (+ (abs 2) 4)))))) (min (max 4 X) (+ (abs 2) (min X (min (min (min (- (+ (min X (+ (abs 2) 4)) 4) 3) 5) (- 1 (min (+ (/ (sqrt 1) (/ (/ 3 (max 4 X)) X)) 4) (+ (sqrt (+ (min (+ (min (+ (abs 2) 4) (* (sqrt (+ (* (+ X 4) X) (sqrt 4))) (tan 4))) 4) (/ X 1)) X)) X)))) (min X (min (+ (min (+ (abs (/ (abs 2) (* (sqrt 4) (/ (abs 2) (max (min 1 (* (+ (min X 4) (* (sqrt 4) (abs 2))) (abs 2))) X))))) (min X (+ (abs 2) 4))) (+ (abs 2) 4)) 4) X))))))) (+ (abs 2) 4)) 4) X))) 3) 5) (/ 1 (min (min (min X (min 1 (max (abs (max 4 (+ (sqrt 3) (- 3 1)))) (+ (max (abs (max 4 (+ (sqrt 3) (- 3 1)))) (+ (sqrt 3) (- 3 1))) (tan X))))) (* (sqrt 4) (tan 4))) (* (min (min 1 5) (max (/ 3 (/ (/ 3 (max 4 (/ (+ (min X (min X (sqrt (abs (abs (abs 2)))))) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min 1 (* (sqrt (min (sqrt 4) (* (sqrt 4) (tan (max 4 X))))) (abs 2)))))) (max 4 (min (max 4 (/ 3 (max 4 X))) 5)))) X)) (+ (+ (min (+ (abs 2) (min X (+ (abs 2) 4))) (+ (abs 2) (tan (+ (abs 2) 4)))) 4) (abs (- (abs 2) 3))))))) (min X (min (+ (+ X 4) 4) X))))) (tan (+ (tan X) (min (+ (min (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) (tan 4)) (+ (min (tan (min X (+ (sqrt (+ (+ (+ (abs 2) (/ X 1)) 4) (/ X (max (/ X 1) X)))) (/ X (max (/ X 1) X))))) (+ (sqrt (+ (+ (+ (abs 2) (/ X 1)) 4) (/ X (max (/ X 1) X)))) (/ X (max (/ X 1) X)))) 4)) (min (max 4 (sqrt (max 4 (/ (max (/ 3 (max 4 X)) (* 5 5)) (max 4 X))))) 5)) X))))))) (min 1 (+ (sqrt (+ (abs X) (tan (/ (min (min (+ (min (min (+ (min X (+ (abs (min (sqrt (max (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))) (min (* (+ 5 2) (max X 4)) (/ (abs (max (abs (/ (sqrt 4) 1)) (/ (max (/ 3 (max 4 X)) (* 5 5)) (max 4 X)))) 1)))) (+ (max (+ X 4) (+ (abs 2) 4)) 4))) 4)) 5) 5) (/ (min (/ 1 (min (min 1 (sqrt (* X (sqrt (* (sqrt (min 1 (* (sqrt 4) (tan 4)))) (abs 2)))))) (* (min (min 1 5) (max 4 X)) X))) 5) (min (min (abs (min 1 (sqrt (min 1 (* (min X (+ (abs 2) 4)) (tan 4)))))) (* (min (min X (min (min 1 5) (max 4 X))) (max 4 X)) X)) (min (min (- (+ (min X (+ (min X (+ (max (+ X 4) (+ (abs (+ (min X (max 4 (min X (+ (abs 2) 4)))) 4)) 4)) 4)) (tan X))) 4) 3) 5) (min (min 5 (sqrt (min 1 (* (sqrt (* (+ (min X (min X (sqrt (abs (max 4 (/ (- (abs X) (min (- (abs X) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min X (+ (abs 2) 4)))) (min 1 (* (sqrt 4) (abs 2))))))))) (abs (min 1 (abs (+ (min X 4) (sqrt (+ (min (+ (min X 4) (sqrt (+ (min X 4) (max (/ 3 (max 4 (/ (max 4 (min (max 4 X) (+ (abs (+ (abs (max 4 1)) 4)) 4))) 1))) X)))) (max 4 (/ 1 (max 4 X)))) (max (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))) (sqrt (max (/ 3 (max 4 (min (max 4 (sqrt (max 4 (/ (max (/ 3 (max 4 X)) (* 5 5)) (max 4 X))))) 5))) (min (* (+ 5 2) (max X (+ (abs (- 1 (tan 2))) (tan X)))) (/ (abs (/ X 1)) 1)))))))))))) (tan 4))) (tan 4))))) (* (min (min 1 5) (max 4 X)) X)))))) 4) (/ (min (/ 1 (min (- (min (min 1 (sqrt (min 1 (* (+ (min (+ (sqrt (+ (min (+ (abs 2) 4) (/ X 1)) X)) X) (min X (sqrt (abs (max 4 (/ (- (abs X) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min 1 (* (sqrt 4) (abs (min (abs 2) (* (sqrt 4) (abs 2)))))))))))) (abs (+ (min X 4) (sqrt (+ (min (+ (min (max 4 X) 4) (sqrt (+ (min X 4) (max (/ (max (/ 3 (max 4 X)) (min (max 4 X) (min X (sqrt (abs (abs (abs 2))))))) (max 4 X)) X)))) (max 4 (/ 1 (max 4 X)))) (max (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))) (sqrt (max (+ (abs 2) (max (/ (abs X) (max 4 (min (max 4 (/ (+ (/ 3 (max 4 X)) 4) (max 4 X))) (min (min (max 4 (/ (+ (/ 3 (max 4 X)) 4) (max 4 X))) 5) 1)))) (min (* (+ 5 2) (max X 4)) (/ (abs (/ X 1)) 1)))) (min (* (+ 5 2) (max X 4)) (/ (min (/ (abs (/ X 1)) 1) 5) 1)))))))))) (tan 4))))) (* (min (min 1 5) (max 4 (/ (max 4 X) (min X (+ (abs 2) 4))))) X)) 3) (* (min (min 1 5) (max 4 X)) X))) 5) (min (min 1 (sqrt (+ (min X (* X (abs (tan (tan (tan 2)))))) (sqrt (min 1 (* (sqrt (min X (min (+ (min (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) (sqrt (/ (* (sqrt (abs (min X (sqrt (abs (abs (abs 2))))))) (/ X 1)) (min X (+ (abs 2) 4))))) (+ (min X (+ (+ (+ (abs 2) (/ X (min (min (- (+ (min X (+ (abs 2) 4)) 4) 3) 5) (- 1 (min (+ (/ (sqrt 1) (/ 4 X)) 4) (+ (sqrt (+ (min (+ (abs 2) 4) (/ X 1)) X)) X)))))) 4) (+ (tan X) (max 4 (+ (tan X) 4))))) 4)) 4) X))) (tan 4))))))) (sqrt (+ (min (+ (abs 2) 4) (/ X 1)) X))))) (min X (+ (abs (+ (min (abs (min (min 1 (min (abs (/ (max 4 X) (abs 2))) (min 1 5))) (+ (min X (min (* (sqrt 4) (min X (sqrt (abs (abs (abs 2)))))) (sqrt (abs (abs (abs 2)))))) (abs (abs (abs X)))))) (+ (min X (min (* (sqrt 4) (min X (sqrt (abs (abs (abs 2)))))) (sqrt (abs (abs (abs 2)))))) (abs (abs (abs X))))) (abs X))) (+ X (+ (abs (+ (min (abs (min (min 1 (min (abs (/ (max 4 X) (abs 2))) (min 1 5))) (+ (min X (min (* (sqrt 4) (min X (sqrt (abs (abs (abs 2)))))) (sqrt (abs (abs (abs 2)))))) (abs (abs (abs X)))))) (+ (min X (min (* (sqrt 4) (min X (sqrt (abs 1)))) (sqrt (abs (abs (abs 2)))))) (abs (abs (abs X))))) (abs X))) (tan (/ (min (min (min (- (abs X) 3) 5) (/ 1 (min (min (* (+ (min (+ (abs 2) 4) (/ (* (sqrt 4) (/ X 1)) 1)) 4) (abs 2)) (* (sqrt 4) (/ (* (sqrt 4) (+ (tan X) (* (sqrt 4) (tan 4)))) (/ 3 X)))) (* (- 1 (tan (min X (tan 2)))) (/ X 1))))) (min X (min (+ (min X (min 1 (min X (+ (abs 2) 4)))) 4) X))) (tan (+ (tan X) X))))))))) (tan (+ (min (+ (min X (+ (abs (min (min X (min (+ (min (+ (abs 2) (min X (+ (abs 2) 4))) (+ (abs 2) 4)) 4) X)) (min (+ (min (+ (abs 2) (min X (+ (abs 2) 4))) (+ (abs 2) 4)) 4) X))) 4)) 4) X) X)))))) (tan (/ (min (min (min (- 1 (tan (min X (tan 2)))) 5) (+ (+ (abs (sqrt (abs (- (abs 2) 3)))) (+ (min (min 1 5) (/ (sqrt 4) (min (min (+ (min (+ (abs 2) (min X (+ (abs 2) 4))) (+ (abs 2) 4)) 4) (+ (min X (min X (sqrt (abs (abs (abs 2)))))) (min 1 (* (sqrt 4) (tan (max 4 X)))))) (* X (min (- (+ (min X (min (min X (+ (min X (+ (abs 2) 4)) (tan X))) (min X (min (+ (min (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) 1) (+ (abs 2) 4)) 4) X)))) (+ (abs 2) (+ (min X (min (min X (+ (min X (+ (abs 2) 4)) (tan X))) (min X (min (+ (min (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) 1) (+ (abs 2) 4)) 4) X)))) 4))) 3) (* (min X 4) X)))))) X)) X)) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (* (min X (- (min (+ (+ (min X (+ (min (+ (* (- (abs X) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) X) (+ (min X 4) (sqrt (+ (min X (* (min X 4) (tan 4))) (max (/ (+ (min (+ (min X 4) (sqrt 2)) (max 4 (/ 1 (max 4 X)))) (max (/ 3 (min (+ (abs 2) 4) (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))))) (sqrt (max (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))) (min (* (+ 5 2) (max X 4)) (/ (abs (/ X 1)) 1)))))) (max 4 (+ (max 4 (/ 1 (min 1 (* (+ (min X 4) (sqrt (+ (min (+ (min X 4) (sqrt (+ (min X 4) 1))) (max 4 (/ 1 (max 4 X)))) (max (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))) (sqrt (max (/ 3 (max 4 (min (max 4 (sqrt (max 4 (/ (max (/ 3 (max 4 X)) (* 5 5)) (max 4 X))))) 5))) (min (* (+ (min (min 1 5) (max 4 X)) 2) (max X (+ (abs (- 1 (tan 2))) (tan X)))) (/ (abs (/ (min (min 1 5) (max 4 (/ (max 4 X) (min X (+ (abs 2) 4))))) 1)) 1)))))))) (abs 2))))) (/ 3 4)))) X))))) (+ (abs 2) 4)) (+ (min X 4) (sqrt (min (min (min (- (+ (min X (+ (abs 2) 4)) 4) 3) 5) (- 1 (min X (/ (min (min 1 (sqrt (min 1 (tan (min 1 (* (sqrt 4) (tan 4))))))) (* (min (min 1 (+ (abs 2) 4)) (max 4 X)) X)) (min X (+ (abs 2) 4)))))) (sqrt (+ (min X 4) (max (/ 3 (max 4 (+ (max 4 (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (/ 3 4)))) X)))))))) (+ (min X 4) (sqrt (+ (min X 4) (max (/ 3 (max 4 (+ (max 4 (/ 1 (min 1 (* (sqrt (min (+ (+ X 4) 4) X)) (abs 2))))) (/ (min 1 (tan 4)) 4)))) X))))) (min (+ (min X (* X (abs (tan (tan (tan 2)))))) (max (+ (min X (* X (abs (tan (tan (tan 2)))))) 4) X)) (sqrt 1))) (* X (abs (tan (tan (tan 2)))))) 2)) (abs (tan 2)))))))))))) (sqrt (+ (/ (min (+ (abs (abs (sqrt (abs 2)))) 4) X) (min X (+ (+ (+ (abs 2) (/ X 1)) 4) (+ (tan X) 4)))) X))))))) (abs (sqrt (+ (* (- (* X (abs (sqrt (+ (abs X) (sqrt (min X (sqrt (abs (abs (abs (+ (+ (+ (* (min (min 1 (tan (* (+ (min (+ (abs 2) 4) (/ (* (/ (/ 2 X) (abs 4)) (/ X 1)) (+ 4 (+ 4 5)))) 4) (abs 2)))) (max 4 X)) X) (+ (min X (min (min X 4) (min X (min 1 5)))) (max (/ 3 (max 4 (/ 1 (min 1 (* (sqrt 4) (abs 2)))))) X))) (+ (min X 4) (max (/ 3 (max 4 (+ (max 4 (/ 1 (max 4 (/ 1 (max 4 X))))) 2))) X))) (abs (tan 2))))))))))))) (/ X 1)) (/ 1 (sqrt (/ (/ (min (/ 1 (min (- (abs X) 3) 5)) 5) (tan (+ (tan X) X))) (+ (sqrt (+ (abs (+ (min X (min X (sqrt (abs (abs (min (max (min X (max 4 X)) X) (max 4 (/ 1 (max 4 X))))))))) (abs X))) (tan (/ (min (min (min (min (min (min (tan (min (min 1 (min X (min 1 5))) (+ (abs 2) 4))) 4) 5) (/ 1 (min (min 1 (* (sqrt 4) (tan (max (abs 2) (* 5 5))))) (* (min (min 1 5) (max 4 X)) (min (* (min (min 1 5) (+ (abs (min 1 (+ (min (+ (+ (+ (abs 2) (min X (+ (abs 2) 4))) 4) (min X (+ (abs 2) 4))) (+ (abs (max 4 1)) 4)) 4))) (min (min 1 5) (max 4 X)))) (+ (+ (* (min (min 1 (tan 4)) (max 4 X)) X) (+ (min X 4) (max (/ 3 (max 4 (/ 1 (min 1 (* (sqrt 4) (abs 2)))))) X))) (+ (min (min 3 (min X 4)) 4) (max (/ 3 (max 4 (/ 1 (max 4 X)))) X)))) (+ (abs 2) 4)))))) (min (* (* (+ (abs 2) (* (min X 1) (sqrt (* (/ X 1) (max 5 (sqrt (max (+ X 4) (- 2 (min X (/ X 1)))))))))) (sqrt (* (/ X 1) (max (* (/ 1 3) (- 5 4)) (/ (min X (min X 4)) (sqrt (/ (abs 2) (+ (abs 2) (/ (abs 2) (+ (abs (- (tan 2) (tan (* (min (min 3 5) (+ (abs (min 1 (+ (min (+ (+ (+ (abs 2) (min X (+ (abs 2) 4))) 4) (min X (+ (abs 2) 4))) (+ (abs (max 4 1)) 4)) 4))) (min (min 1 5) (max 4 X)))) (tan 2))))) (min 1 (* (sqrt 4) (tan 4))))))))))))) (sqrt (* (* (min X 1) (sqrt (* (min (abs 2) 1) (max (max (abs (- (+ (min X (+ (min (tan 1) (+ (abs 2) 4)) (tan X))) 4) 3)) (/ 1 (min 1 (* (sqrt (min (+ (+ X 4) 4) X)) (abs 2))))) (/ (min X (sqrt (max (+ X 4) (/ (sqrt 4) 3)))) (sqrt (/ (/ (max 4 X) (/ 1 (max (min (max 4 X) (max 4 (/ 1 (max 4 X)))) X))) (max 4 X)))))))) X))) (min (max 4 (- (max 4 X) 2)) (max (+ X X) (- 2 (min X (/ X (* (sqrt 4) (tan 4))))))))) (min (min (min X (min X (min (+ (min X (+ (abs 2) 4)) (* (min 1 1) (max 3 4))) X))) (abs (- 2 (min (+ (min (min 1 (* (min (* (- (+ (min X (+ (abs 2) 4)) 4) (+ (+ (+ (abs 2) 4) (max (/ 3 (max 4 (- 1 (max 3 4)))) X)) (abs 2))) (tan (max (abs 2) (* 5 5)))) (* (min (min 1 (min X (min (min (min (- (+ (min X (+ (abs 2) 4)) 4) 3) 5) (- (max 4 (min 1 (* (* (/ 1 3) (- 5 4)) (tan 4)))) (min (+ (/ (sqrt 1) (/ 4 X)) 4) (+ (sqrt (+ (min (+ (abs 2) 4) (/ X 1)) X)) X)))) (min X (min (+ (min (+ (abs 2) (min X (+ (abs 2) 4))) (+ (abs 2) 4)) 4) X))))) (max 4 X)) X)) (tan (max (abs 2) (* 5 5))))) (* (min (min (max (abs 2) (* 5 5)) 5) (+ (abs 2) 4)) (+ (* (min (min 1 (abs X)) (+ (min (min X (+ (abs 2) 4)) (+ (abs (min (abs 2) (+ (abs 2) 4))) 4)) (min (min 1 (tan 4)) (max 4 X)))) X) 4))) 4) (* (min (min (max (abs 2) (* 5 5)) 5) (+ (abs 2) 4)) (+ (* (min (min 1 (abs X)) (+ (min (min X (+ (abs 2) 4)) (+ (abs (min (abs 2) (+ (abs 2) 4))) 4)) (min (min 1 (tan 4)) (max 4 X)))) X) 4)))))) 5)) (min (/ (* (* (+ (abs 2) (+ (+ (abs 2) (+ (* (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) (* X (max 4 (/ 1 (max 4 X))))) (max 4 (/ 1 (max 4 X)))) 4)) 4)) (sqrt (* (/ X 1) (max (* (/ 1 3) (- 5 4)) (/ (min X (sqrt (max (+ X 4) (- (+ (- 2 (min X (* (min X (/ X 1)) X))) X) (min X (/ X 1)))))) (sqrt (/ (abs 2) (+ (abs 2) (/ (abs 2) (+ (abs (- (tan 2) (tan 2))) (min 1 (* (sqrt 4) (tan 4))))))))))))) (sqrt (* (* (min X 1) (sqrt (* (min (abs 2) 1) (max 5 (/ (min X (sqrt (max (+ X 4) (/ (+ (min X (+ (abs 2) 4)) (min (+ (tan 4) 4) (max 4 X))) 3)))) (sqrt (/ (/ (max 4 X) (/ 1 (max (min (max 4 X) (max 4 (/ 1 (max 4 X)))) X))) (max 4 X)))))))) X))) (+ (abs (* (sqrt (+ (abs 2) (sqrt (* (+ (min X (min X (sqrt (abs (max 4 (/ (- (abs X) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min 1 (* (sqrt 4) (abs 2))))))))) (abs (+ (min X 4) (sqrt (+ (min (+ (min X 4) (sqrt (+ (min X 4) (max (/ 3 (max 4 X)) X)))) (max 4 (/ 1 (+ (abs 2) (/ 1 (max 4 X)))))) (min X (sqrt (- 5 3)))))))) (tan 4))))) (+ (min X (+ (abs 2) (sqrt (+ (abs 2) 4)))) (* (sqrt (* (+ (min X (min X (sqrt (abs (max 4 (/ (- (abs X) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min 1 (* (sqrt 4) (abs 2))))))))) (abs (+ (min X 4) (sqrt (+ (min (+ (min X 4) (sqrt (+ (min X 4) (max (/ 3 (max 4 X)) X)))) (max 4 (/ 1 (max 4 X)))) (min X (sqrt (- 5 3)))))))) (tan 4))) (tan 4))))) (tan X))) (min (+ (min X (+ (abs (+ (min X (/ 3 (max 4 (/ 1 (max 4 X))))) (max 4 X))) 4)) 4) (+ (abs 2) (min (+ (abs X) 4) X))))) (tan (+ (tan X) X)))))) (min 1 (+ (sqrt (+ (abs X) (tan (/ (min (min (min (- (+ (min X (+ (min X (+ (abs 2) 4)) (tan X))) 4) 3) 5) (tan 4)) (min (min 1 (* (sqrt 4) (abs 2))) (min (+ (min (min (- (+ (min X (+ (min X (+ (abs 2) 4)) (max (/ 3 4) X))) 4) 3) 5) (+ (* (+ (min (+ (/ (sqrt 1) (/ 4 X)) 4) (+ (sqrt (+ (min (+ (abs 2) 4) (/ X 1)) X)) X)) (min X (/ 3 (min X (min 1 5))))) (min X (min 1 5))) (min 1 (* (sqrt 4) (tan 4))))) 4) X))) (min (/ (min (max 4 (min (min (min (- (+ (min X (+ (abs 2) 4)) 4) 3) 5) (- 2 (min X (/ (sqrt (min 1 (* (sqrt (+ (sqrt 4) 4)) (tan 4)))) 1)))) (min X (min (+ (min (+ (+ (min X (/ X 1)) (/ 3 (min 1 5))) (min (/ (* (sqrt (abs (sqrt 4))) (/ (/ (/ X 1) (max 4 X)) 1)) (min X (+ (abs 2) 4))) (+ (min X (+ (+ (+ (abs 2) (/ X 1)) 4) (+ (min (sqrt 4) (+ (tan X) 4)) 4))) 4))) (+ (min X (+ (+ (+ (abs 2) (/ X 1)) 4) (+ (tan X) 4))) 4)) 4) X)))) (min X (min (+ (min (- (+ (- 2 (min X (* (min X (/ X 1)) X))) 4) (min X (/ X 1))) (+ (abs 2) (abs (+ (min 1 1) 4)))) 4) X))) (tan (+ (tan X) X))) (+ (abs (+ (min X (min X (sqrt (abs (max 4 (/ (- (abs X) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min 1 (* (sqrt 4) (abs 2))))))))) (abs (+ (min X 4) (sqrt (+ (min (+ (min X (- (+ (min X (+ (min X (+ (abs 2) 4)) (tan X))) 4) (min X 4))) (sqrt (+ (min X 4) (max (/ 3 (max 4 X)) X)))) (max 4 (/ (* (min 1 1) (max 3 4)) (max 4 X)))) (max (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))) (sqrt (max (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))) (min (* (+ 5 2) (max X 4)) (/ (abs (/ X 1)) 1))))))))))) (tan (/ (min (min (min (min (min (min X 4) 5) (/ 1 (min (min 1 (* (- (+ (min X (+ (abs 2) 4)) 4) 3) (tan (max (abs 2) (* 5 5))))) (* (min (+ (abs X) (min (min (max (abs 2) (* 5 5)) 5) (max 4 X))) (max 4 X)) (+ (* (min (min 1 (tan 4)) (+ (min X (+ (abs 2) 4)) (min (+ (tan 4) 4) (max 4 X)))) X) 4))))) (min X (min (+ (min X (+ (abs 2) 4)) 4) X))) (min X (min 1 (min X 5)))) (min X (min (+ (/ 3 (max 4 (- 1 (max 3 4)))) (+ (abs 2) 4)) X))) (tan (+ (tan X) X)))))))))) (tan (abs (min (abs (+ (min X (+ (abs (max 4 (abs 2))) (min X (/ (min (min 1 (sqrt (min 1 (* (sqrt 4) (tan 4))))) (* (min (min 1 (+ (abs 2) 4)) (max 4 X)) X)) (min X (+ (abs 2) 4)))))) 4)) 5)))))))))) (sqrt (+ (/ (min (+ (+ (min X (+ (min (+ (abs 2) (min X (+ (abs 2) 4))) (+ (abs (max 4 1)) 4)) 4)) (/ (abs (/ 3 (min 1 5))) (min 1 5))) 4) X) (+ (* (- X (/ X 1)) (* X (abs (sqrt (+ (* (+ X 4) X) (sqrt (min (/ (min X (+ (abs 2) 4)) (max 4 (/ (/ 1 (min 1 (* (sqrt 4) (abs 2)))) (min 1 (* (sqrt 4) (abs 2)))))) (sqrt (abs (abs (abs (min (+ (min (min X (min X (min 1 (sqrt (min 1 (* (sqrt (+ (* (+ X 4) X) (sqrt 4))) (tan 4))))))) (max (min (min (min (min X (min (min (min (min (- (abs (min X (min (+ (min (min (- (+ (min X (+ (abs 2) (sqrt (+ (/ (max 4 X) (abs 2)) 4)))) 4) 3) 5) (+ (abs 2) 4)) 4) X))) 3) 5) (/ 1 (min (min (min X (min 1 (max 4 (min 1 (* (* (/ 1 3) (- 5 4)) (tan 4)))))) (* (sqrt 4) (tan 4))) (* (min (min (/ (max 4 X) (min X (+ (abs 2) 4))) 5) (max (/ 3 (max 4 (/ (+ (min X (min X (sqrt (abs (abs (abs 2)))))) (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (min 1 (* (sqrt (min (sqrt 4) (* (sqrt (max (/ 3 (max 4 (- 1 (max 3 4)))) (sqrt 4))) (tan (max 4 X))))) (abs 2)))))) X)) (+ (* (+ (min (+ (abs 2) 4) (+ (min (+ (* (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) (* X (max 4 (/ 1 (max 4 X))))) (max 4 (/ 1 (max 4 X)))) 4) (/ X 1)) X)) 4) X) (* (+ (* (+ (min (+ (abs 2) 4) (min (min (+ (abs 2) 4) (/ (* (sqrt (abs (sqrt (abs 2)))) (/ X 1)) 1)) (+ (abs 2) 4))) (min (min 1 (min 1 5)) (max (/ 3 (max 4 (/ 1 (min 1 (* (sqrt 4) (abs 2)))))) (* (min (tan (min (min 1 (min X (min 1 5))) (+ (abs 2) 4))) (max 4 (/ 3 (max 4 (min (max 4 (/ 3 (max 4 X))) 5))))) X)))) X) 4) (tan 4))))))) (min X (min X (sqrt (abs (abs (abs 2))))))) (min X (sqrt (abs (abs (abs 2))))))) (/ 3 (max 4 (/ 1 (max 4 X))))) (min X (min X (sqrt (abs (abs (abs 2))))))) (min X (sqrt (abs (abs (abs 2)))))) (min (min (min (- (+ (tan (+ (min X (+ (abs 2) 4)) 4)) 4) 3) 5) (- (min (- 2 (sqrt (abs (- (abs 2) 3)))) (max 4 (/ 1 (max 4 X)))) (min X (* (sqrt 4) (abs 2))))) (min X (min (+ (min (/ (* (sqrt (abs (sqrt 4))) (/ X 1)) 1) (+ (abs 2) 4)) 4) X))))) 4) (abs (min (+ (min X (min X (sqrt (abs (abs (abs 2)))))) 4) (+ (abs 2) 4))))))))))))))) (/ (+ (* (- X (/ X 1)) (sqrt (/ 1 4))) (- X (/ X 1))) (/ (+ (min (min (+ (min 1 5) (/ 3 4)) 5) (/ (sqrt 4) (min (min (min (min (min (min (min X 4) 5) (/ 1 (min (min 1 (* (- (+ (min X (+ (min X (tan 2)) (sqrt (+ (min X 4) (max (/ 3 (max 4 X)) X))))) 4) 3) (tan (max (abs 2) (* 5 5))))) (* (min (min (max (abs 2) (* 5 5)) 5) (max 4 X)) (+ (* (min (min 1 (tan 4)) (+ (min X (+ (abs 2) 4)) (min (+ (tan 4) 4) (max 4 X)))) X) 4))))) (min X (min (+ (min X (+ (abs 2) 4)) 4) X))) (min X (min 1 (min X 5)))) (+ (abs 2) (min X (+ (abs 2) 4)))) (* X (min (- (+ (min X (+ (min X (+ (abs 2) 4)) (tan X))) 4) 3) (* X (tan (* X X)))))))) X) X)))) X)))))) 4) X) (- (abs (min (- (+ (min X (+ (abs 2) 4)) 4) 3) (abs (- 2 2)))) 2)) 2)) (* X (abs (sqrt (min (+ (min X 4) (sqrt (+ (min (+ (min (/ 3 (max 4 (/ 1 (abs (/ 1 (max 4 X)))))) (+ (abs 2) 4)) (sqrt (+ (min (abs (min X 4)) 4) (max (/ 3 (max 4 X)) X)))) 4) (max (/ (min (min (min (- (+ (min X (+ (* (tan (min (- (+ (min X (+ (min X (+ (+ (+ (abs 2) 4) (max (/ (max (/ 3 (max 4 (- 1 (max 3 4)))) X) (tan (+ (tan X) X))) X)) (abs 2))) (tan X))) 4) 3) (* X (tan (* X (- (* X X) (tan 2))))))) (* 5 2)) (tan X))) 4) 3) (min 1 (min (- (+ (min (+ (min X (+ (min X (+ (max (+ X 4) (+ (abs 2) 4)) 4)) (tan X))) 4) (min X (+ (abs 2) 4))) 4) 3) 5))) (- (* (+ 5 2) (- 2 (min X (/ 1 (min X (min (min (min 1 5) (max 4 X)) X)))))) (min X (/ 1 (min X (min (min (min 1 5) (max 4 X)) X)))))) (/ 3 (min 1 5))) (max (max 4 (/ 1 (min 1 (* (sqrt 4) (abs 2))))) (+ (min X (/ (min X 4) (max 4 (/ 1 (max 4 X))))) (max 4 X)))) X)))) 4)))))",
				"(abs (* (- (pow (- (* 1 X) 1) 2) 1) (pow (pow (- (* (- (cos (abs (cos (abs (log 1))))) 1) (abs 1)) (abs (cos (+ 4 4)))) 2) (pow (log (pow (+ 4 4) (- (+ (cos (+ 4 4)) (- (- (- (+ (cos (pow (log (+ 4 (- (* (- (pow (cos (abs (cos (+ 4 4)))) 2) (+ (cos (+ (* 1 X) (pow (cos (pow (cos (abs (cos (+ 4 4)))) 2)) 2))) 4)) (abs 1)) (+ (cos (+ (* 1 X) (pow (cos (pow (cos (abs (cos (+ 4 4)))) (log 1))) 2))) 4)))) (cos (+ 4 4)))) 4) (+ (- 5 (+ (cos (+ (cos (pow (+ 4 4) (+ (pow (+ (+ (+ 4 (ceil X)) (pow (cos (pow (ceil (+ 3 1)) 2)) 2)) (pow (cos (pow (cos (abs (cos (+ 4 4)))) 2)) 2)) 2) 4))) (pow (cos (+ 4 4)) 2))) 4)) 4)) 1) (+ (pow (cos (pow (cos (abs (cos (+ 4 4)))) (cos (abs (pow (+ 4 (pow (+ 4 4) 2)) (* (pow (+ 4 (+ (+ 4 (pow (cos (pow (cos (abs (cos (+ 4 4)))) (+ 4 4))) 2)) (pow (cos (pow (cos (pow (log 3) (* X 3))) 2)) 2))) (ceil X)) (pow (+ 4 (cos (ceil 1))) (* X 3)))))))) (pow (cos (abs (cos (+ (cos (+ (abs (cos (+ (cos (+ 4 4)) 4))) 4)) (cos (abs (log 1))))))) 2)) 4))) (pow (+ 4 (pow (+ (cos (+ (+ 4 4) (pow (cos (+ (ceil 5) (log 4))) 2))) 4) (ceil X))) (log (cos (cos (pow (pow (log (+ (+ (+ 4 4) 4) 4)) (pow (cos (pow (+ 4 (pow (cos (pow (pow (log (+ 4 4)) (pow (cos (pow (+ 4 (pow (- (cos (pow (pow (+ 4 (pow (cos (pow (cos (abs (cos (+ 4 4)))) 2)) 2)) (pow (cos (abs (cos (+ 4 4)))) 2)) 2)) (+ (cos (+ (cos (pow (cos (abs 4)) (abs (cos (+ 4 4))))) 4)) 4)) 2)) (* (pow (+ 4 (+ (+ 4 (pow (cos (pow (cos (abs (cos (+ (pow (+ 4 4) 2) (cos (+ 4 4)))))) 2)) 2)) (log 1))) (- (cos (- (ceil X) X)) (pow (cos (abs (cos (+ 4 4)))) 2))) (pow (log (* (pow X 1) 1)) (* (+ 4 4) 3))))) (* (pow (+ 4 (pow (cos (+ 4 4)) (+ (+ 4 (pow (+ 4 (pow (cos (pow (cos (+ 4 (cos (abs (cos (+ 4 4)))))) 2)) 2)) 2)) (log 1)))) (ceil X)) (pow (log 3) (* X 3))))) 2)) 2)) (* (pow (+ 4 (+ (+ 4 (pow (cos (pow (cos (abs (cos (+ 4 4)))) 2)) 2)) (pow (cos (pow (cos (abs (cos (+ 4 4)))) 2)) 2))) (ceil (cos (abs (* X 3))))) (pow (log 3) (* X 3))))) (* (ceil (* X 2)) (pow (log 3) (* X (pow (* X 3) 1)))))) 2)))))))) (log (cos (cos (log (log (- 5 (+ (- 5 (+ (cos (+ 4 4)) (- (- (- (+ (cos (pow (log (pow (log (+ 4 4)) 2)) (cos (+ 4 4)))) 4) (cos (pow (cos (abs (cos (+ (cos (+ (pow (+ 4 4) 2) (cos (+ 4 4)))) 4)))) 2))) (pow (+ 4 (pow (cos (pow (cos (abs (cos (+ 4 4)))) 2)) (+ (+ 4 (pow (cos (pow (cos (abs (cos (+ 4 4)))) (+ 3 1))) 2)) (log 1)))) 2)) (+ (- 5 (+ (cos (+ (cos (pow (cos (pow (cos (abs (cos (+ 4 4)))) 2)) 2)) (pow (cos (abs (cos (+ 4 4)))) 2))) 4)) (+ (pow (+ 4 4) 2) (+ (cos (abs (cos (+ 4 4)))) 4)))))) 4)))))))))))"
		};
		for (int k=0; k<2; k++){
			for (int type=1; type<=3; type++){
				double[][] points = null;
				File f;
				PrintWriter out = null;
				if (type == 1){
					points = sfr.readFile("f1.txt"); type = 1;
				} else if (type==2){
					points = sfr.readFile("f2.txt"); type = 2;
				} else if (type==3){
					points = sfr.readFile("f3.txt"); type = 3;
				}
				f = new File (k+"function" + type + ".txt");
				try {
					out = new PrintWriter(f);
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
				SymbolicRegressionPhenotype p = new SymbolicRegressionPhenotype(points, type*k);
				TreeNode t = parse(p.getTerminals(), p.getFunctions(), strs[k*3+type-1]);
				new SymbolicRegressionGenotype(t).printPoints(points, out);
				out.close();
				System.out.println(t.toString().equals(strs[k*3+type-1]));
			}
		}
	}
}
